nix-community / nixGL

A wrapper tool for nix OpenGL application [maintainer=@guibou]
712 stars 80 forks source link

Nvidia icd file has now a disctinct name #93

Closed leiserfg closed 1 year ago

leiserfg commented 2 years ago

Running nix-env -iA nixgl.auto.nixVulkanNvidia
returns

ls: cannot access '/nix/store/5ffhwa9kp5hay6ml0yk40vl8dj65gsmi-nvidia-x11-510.54/share/vulkan/icd.d/nvidia_icd.json': No such file or directory

The new name is nvidia_icd.x86_64.json

guibou commented 2 years ago

I added a test which build with nvidia-x11-510 and it looks like it generate a wrapper script which points to the correct icd files. Could you test again and tell me if the bug is still there?

Thank you for opening the ticket by the way ;)

leiserfg commented 2 years ago

I'm not currently using this any more (since I wanted to have both gl and vulkan available), I'm injecting the vars in the environment, this is a piece of my code (mostly borrowed from nixGL) and it works fine:

      nvidiaVars = {
            VK_LAYER_PATH="${vulkan-validation-layers}/share/vulkan/explicit_layer.d";
            VK_ICD_FILENAMES=''${nvidiaLibsOnly}/share/vulkan/icd.d/nvidia_icd.x86_64.json${
                  lib.optionalString enable32bits
                  ":${nvidiaLibsOnly.lib32}/share/vulkan/icd.d/nvidia_icd.i686.json"
                }'';
            OCL_ICD_VENDORS="${nvidiaLibsOnly}/etc/OpenCL/vendors/";
            LD_LIBRARY_PATH=''${
                lib.makeLibraryPath ([ libglvnd nvidiaLibsOnly  vulkan-validation-layers]
                  ++ lib.optionals enable32bits [
                    nvidiaLibsOnly.lib32
                    pkgsi686Linux.libglvnd
                    vulkan-loader
                    libICE
                  ])
              }'' ;
seandheath commented 2 years ago

@leiserfg would you mind providing an example of how to use the nvidiaVars you defined in a config.nix setup?

leiserfg commented 2 years ago

What I'm doing is just expose them in home.sessionVariables so every program runs with them set, it's impure I know but it's the less problematic way I've found.