From 007af34263d102667f077363b3958e6bf4b05ea8 Mon Sep 17 00:00:00 2001 From: Brandon Weeks Date: Tue, 18 Jan 2022 00:16:04 -0800 Subject: [PATCH] google-chrome: add /run/opengl-driver/share/vulkan/icd.d/ to path NixOS stores ICDs at /run/opengl-driver/share/vulkan/icd.d/. Because Chrome ships its own vulkan-loader and doesn't use the NixOS system vulkan-loader, Chrome won't search the /run/opengl-driver directory withou either adding it to the path or patching Chrome's libvulkan.so.1. This change adds "${addOpenGLRunpath.driverLink}/share" unconditionally to the path. addOpenGLRunpath is the same module that NixOS system vulkan-loader uses as the path. Tested by running `VK_LOADER_DEBUG=all google-chrome-unstable --enable-features=Vulkan` and verifying Vulkan is enabled with chrome://gpu. --- .../networking/browsers/google-chrome/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/browsers/google-chrome/default.nix b/pkgs/applications/networking/browsers/google-chrome/default.nix index 33a9e9f865cb..e93ea8ca66d1 100644 --- a/pkgs/applications/networking/browsers/google-chrome/default.nix +++ b/pkgs/applications/networking/browsers/google-chrome/default.nix @@ -44,7 +44,7 @@ , libvaSupport ? true, libva # For Vulkan support (--enable-features=Vulkan) -, vulkanSupport ? true, vulkan-loader +, addOpenGLRunpath }: with lib; @@ -70,7 +70,6 @@ let libxkbcommon pipewire wayland ] ++ optional pulseSupport libpulseaudio ++ optional libvaSupport libva - ++ optional vulkanSupport vulkan-loader ++ [ gtk3 ]; suffix = if channel != "stable" then "-" + channel else ""; @@ -143,7 +142,7 @@ in stdenv.mkDerivation { makeWrapper "$out/share/google/$appname/google-$appname" "$exe" \ --prefix LD_LIBRARY_PATH : "$rpath" \ --prefix PATH : "$binpath" \ - --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \ + --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH:${addOpenGLRunpath.driverLink}/share" \ --add-flags ${escapeShellArg commandLineArgs} for elf in $out/share/google/$appname/{chrome,chrome-sandbox,${crashpadHandlerBinary},nacl_helper}; do