I have been trying to get this flake devshell to work for a few weeks now but I have not been able to get my system to recognize VULKAN_SDK environment path. When examining the Vulkan Installation Analysis, it states that there is no VULKAN_SDK directory and no Implicit layers directory.
There have been instances of other people with similar problems, but their solutions either do not work, or are simply “i figured it out” with no other context.
Here is my flake:
{
description = "Description for the project";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
# To import a flake module
# 1. Add foo to inputs
# 2. Add foo as a parameter to the outputs function
# 3. Add here: foo.flakeModule
];
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
# Per-system attributes can be defined here. The self' and inputs'
# module parameters provide easy access to attributes of the same
# system.
# Equivalent to inputs'.nixpkgs.legacyPackages.hello;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
dotnet-sdk_8
freetype
boost
cmake
catch2
glm
gcc
#Xorg
xorg.libXxf86vm
xorg.libXi
xorg.libX11
xorg.libXrandr
#Vulkan
glfw
shaderc
shaderc.bin
shaderc.static
shaderc.dev
shaderc.lib
vulkan-volk
vulkan-headers
vulkan-loader
vulkan-validation-layers
vulkan-tools
shaderc
renderdoc
tracy
vulkan-tools-lunarg
];
LD_LIBRARY_PATH="${pkgs.vulkan-loader}/lib";
# VULKAN_SDK = "${pkgs.vulkan-validation-layers}/share/vulkan/implicit_layer.d";
VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
VULKAN_LIB_DIR = "${pkgs.shaderc.dev}/lib";
shellHook = "
echo ${pkgs.vulkan-loader}
echo ${pkgs.vulkan-validation-layers}
";
};
};
flake = {
# The usual flake attributes can be defined here, including system-
# agnostic ones like nixosModule and system-enumerating ones, although
# those are more easily expressed in perSystem.
};
};
}
In addition here is my project output if it assists in any way as it is trying to grab a filesystem from Nvidia that seems to be outdated
[sn@nixos:~/Documents/projects/vulkan-engine]$ make test
./VulkanTest
validation layer: loader_add_layer_properties: 'layers' tag not supported until file version 1.0.1, but /run/opengl-driver/share/vulkan/implicit_layer.d/nvidia_layers.json is reporting version 1
available extensions:
VK_KHR_device_group_creation
VK_KHR_display
VK_KHR_external_fence_capabilities
VK_KHR_external_memory_capabilities
VK_KHR_external_semaphore_capabilities
VK_KHR_get_display_properties2
VK_KHR_get_physical_device_properties2
VK_KHR_get_surface_capabilities2
VK_KHR_surface
VK_KHR_surface_protected_capabilities
VK_KHR_wayland_surface
VK_KHR_xcb_surface
VK_KHR_xlib_surface
VK_EXT_acquire_drm_display
VK_EXT_acquire_xlib_display
VK_EXT_debug_report
VK_EXT_debug_utils
VK_EXT_direct_mode_display
VK_EXT_display_surface_counter
VK_EXT_surface_maintenance1
VK_EXT_swapchain_colorspace
VK_KHR_portability_enumeration
VK_LUNARG_direct_driver_loading
required extensions:
VK_KHR_surface
VK_KHR_wayland_surface
VK_EXT_debug_utils
Device count: 1
physical device: NVIDIA GeForce RTX 3070 Laptop GPU
Present mode: V-Sync
validation layer: Validation Error: [ VUID-VkPipelineMultisampleStateCreateInfo-sType-sType ] | MessageID = 0x380a52f5 | vkCreateGraphicsPipelines(): pCreateInfos[0].pMultisampleState->sType must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO. The Vulkan spec states: sType must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkPipelineMultisampleStateCreateInfo-sType-sType)
validation layer: Validation Error: [ VUID-VkPipelineMultisampleStateCreateInfo-rasterizationSamples-parameter ] | MessageID = 0xf690d38b | vkCreateGraphicsPipelines(): pCreateInfos[0].pMultisampleState->rasterizationSamples is zero. The Vulkan spec states: rasterizationSamples must be a valid VkSampleCountFlagBits value (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkPipelineMultisampleStateCreateInfo-rasterizationSamples-parameter)
validation layer: Validation Error: [ VUID_Undefined ] | MessageID = 0x79de34d4 | vkCreateGraphicsPipelines(): pCreateInfos[0].pMultisampleState->rasterizationSamples must be greater than 0.
failed to acquire next swap chain image!
make: *** [Makefile:11: test] Error 1
Thanks for any help