Vulkan Validation Layers fail to build

Issue:

Running the command:

 sudo nixos-rebuild switch --upgrade .

I am getting the following message in the output:

compilation terminated.
make[2]: *** [layers/CMakeFiles/vvl.dir/build.make:146: layers/CMakeFiles/vvl.dir/best_practices/bp_descriptor.cpp.o] Error 1
make[2]: *** [layers/CMakeFiles/vvl.dir/build.make:272: layers/CMakeFiles/vvl.dir/best_practices/bp_synchronization.cpp.o] Error 1
In file included from /build/source/layers/./state_tracker/pipeline_state.h:27,
                 from /build/source/layers/./state_tracker/cmd_buffer_state.h:24,
                 from /build/source/layers/./best_practices/best_practices_validation.h:24,
                 from /build/source/layers/best_practices/bp_instance_device.cpp:20:
/build/source/layers/./utils/shader_utils.h:28:10: fatal error: spirv-tools/libspirv.h: No such file or directory
   28 | #include <spirv-tools/libspirv.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [layers/CMakeFiles/vvl.dir/build.make:216: layers/CMakeFiles/vvl.dir/best_practices/bp_instance_device.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:162: layers/CMakeFiles/vvl.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
error: builder for '/nix/store/45k0fjdy7p87z7kkqcpwf62mcdcm728z-vulkan-validation-layers-1.3.283.0.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/fqs01il7xzjsfidd0ky5wg22m2va8xmm-graphics-drivers.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gwhaqfkpfwwlbsgaw5ixdiwys8d4cs19-graphics-driver.conf.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4ilhf55nahz85klkw5sl3jxpschy3ba2-tmpfiles.d.drv' failed to build
error: 1 dependencies of derivation '/nix/store/13mnxnq6ych78hak3q9wq7svv2qjlf5k-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/sxf8d3qxf5wm2nknpspnwhbc3c78v457-nixos-system-linux-24.11pre666839.c3aa7b8938b1.drv' failed to build

nix-shell -p nix-info --run “nix-info -m”
install: cannot remove ‘/tmp/env-vars’: Operation not permitted

  • system: "x86_64-linux"
  • host os: Linux 6.10.3, NixOS, 24.11 (Vicuna), 24.11pre665011.a58bc8ad7796
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.18.5
  • channels(root): "nixos, nixpkgs"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
1 Like

Do you expect it to build locally at all instead of being fetched from public cache?

Do you intentionally have two channels?

I’m also experiencing this same error for the past day or so. Figured it’ll be fixed within a few days.

I had had the unstable channel at first(failed to build), and I added 24.05 but it required me to change most of my config. I added unstable back and I forgot to remove 24.05.

I don’t know why it is not fetching from public cache

Did you check what channels you have exactly? nix-channel --list with and without sudo.

I have fixed the double channel issue and added the correct unstable channel.
sudo nix-channel --list
nixos nixos-unstable release nixos-24.11pre666839.c3aa7b8938b1
nix-channel --list
nixos nixos-unstable release nixos-24.11pre666839.c3aa7b8938b1
I also checked hydra
hydra-check --channel unstable vulkan-validation-layers

Build Status for nixpkgs.vulkan-validation-layers.x86_64-linux on unstable
:heavy_check_mark: vulkan-validation-layers-1.3.283.0 from 2024-08-17 - Hydra - Build 269878850 of job nixos:trunk-combined:nixpkgs.vulkan-validation-layers.x86_64-linux

You still seem to have a double channel issue. You probably want only root to have the nixos channel.

To help more, access to your configuration might be necessary.

Removing the double channel resolved my issue.