Skip to content

Commit

Permalink
google-chrome: replace bundled libvulkan.so.1 with vulkan-loader's
Browse files Browse the repository at this point in the history
When Chrome run by `google-chrome-stable --use-vulkan --enable-features=Vulkan`
without this, it fails to create vk instance giving the below log:

[216457:216457:1003/211719.770352:ERROR:vulkan_instance.cc(112)] Failed to load 'libvulkan.so.1': libvulkan.so.1: cannot open shared object file: No such file or directory
[216457:216457:1003/211719.770434:ERROR:gpu_init.cc(1209)] Failed to create and initialize Vulkan implementation.

Closes NixOS#346197

Signed-off-by: John Titor <[email protected]>
(cherry picked from commit cd0a0da)
  • Loading branch information
JohnRTitor authored and presto8 committed Oct 9, 2024
1 parent 5e7d2c3 commit 288907e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkgs/by-name/go/google-chrome/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
nss,
pango,
pipewire,
vulkan-loader,
wayland, # ozone/wayland

# Command line programs
Expand Down Expand Up @@ -152,6 +153,7 @@ let
speechd
systemd
util-linux
vulkan-loader
wayland
wget
]
Expand Down Expand Up @@ -209,9 +211,12 @@ let
exe=$out/bin/google-chrome-$dist
mkdir -p $out/bin $out/share
cp -v -a opt/* $out/share
cp -v -a usr/share/* $out/share
cp -a opt/* $out/share
cp -a usr/share/* $out/share
# replace bundled vulkan-loader
rm -v $out/share/google/$appname/libvulkan.so.1
ln -v -s -t "$out/share/google/$appname" "${lib.getLib vulkan-loader}/lib/libvulkan.so.1"
substituteInPlace $out/share/google/$appname/google-$appname \
--replace-fail 'CHROME_WRAPPER' 'WRAPPER'
Expand Down

0 comments on commit 288907e

Please sign in to comment.