shader-slang / slang

Making it easier to work with shaders
MIT License
1.97k stars 166 forks source link

Vulkan Issues on Multiple Computers #4643

Closed half-potato closed 1 month ago

half-potato commented 1 month ago

Computer 1:

/home/dronelab/slang/tools/gfx/vulkan/vk-api.h:320:5: error: ‘VkPhysicalDeviceRayTracingValidationFeaturesNV’ does not name a type; did you mean ‘VkPhysicalDeviceRayTracingMotionBlurFeaturesNV’?
  320 |     VkPhysicalDeviceRayTracingValidationFeaturesNV rayTracingValidationFeatures = {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     VkPhysicalDeviceRayTracingMotionBlurFeaturesNV
In file included from /home/dronelab/slang/tools/gfx/vulkan/vk-api.cpp:2:
/home/dronelab/slang/tools/gfx/vulkan/vk-api.h:320:5: error: ‘VkPhysicalDeviceRayTracingValidationFeaturesNV’ does not name a type; did you mean ‘VkPhysicalDeviceRayTracingMotionBlurFeaturesNV’?
  320 |     VkPhysicalDeviceRayTracingValidationFeaturesNV rayTracingValidationFeatures = {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     VkPhysicalDeviceRayTracingMotionBlurFeaturesNV
In file included from /home/dronelab/slang/tools/gfx/vulkan/vk-descriptor-allocator.h:5,
                 from /home/dronelab/slang/tools/gfx/vulkan/vk-descriptor-allocator.cpp:1:
/home/dronelab/slang/tools/gfx/vulkan/vk-api.h:320:5: error: ‘VkPhysicalDeviceRayTracingValidationFeaturesNV’ does not name a type; did you mean ‘VkPhysicalDeviceRayTracingMotionBlurFeaturesNV’?
  320 |     VkPhysicalDeviceRayTracingValidationFeaturesNV rayTracingValidationFeatures = {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     VkPhysicalDeviceRayTracingMotionBlurFeaturesNV
make[2]: *** [CMakeFiles/gfx.dir/build.make:776: CMakeFiles/gfx.dir/tools/gfx/vulkan/vk-device-queue.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/gfx.dir/build.make:692: CMakeFiles/gfx.dir/tools/gfx/vulkan/vk-api.cpp.o] Error 1
In file included from /home/dronelab/slang/tools/gfx/vulkan/vk-base.h:10,
                 from /home/dronelab/slang/tools/gfx/vulkan/vk-buffer.h:4,
                 from /home/dronelab/slang/tools/gfx/vulkan/vk-buffer.cpp:2:
/home/dronelab/slang/tools/gfx/vulkan/vk-api.h:320:5: error: ‘VkPhysicalDeviceRayTracingValidationFeaturesNV’ does not name a type; did you mean ‘VkPhysicalDeviceRayTracingMotionBlurFeaturesNV’?
  320 |     VkPhysicalDeviceRayTracingValidationFeaturesNV rayTracingValidationFeatures = {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     VkPhysicalDeviceRayTracingMotionBlurFeaturesNV
In file included from /home/dronelab/slang/tools/gfx/vulkan/vk-base.h:10,
                 from /home/dronelab/slang/tools/gfx/vulkan/vk-command-buffer.h:4,
                 from /home/dronelab/slang/tools/gfx/vulkan/vk-command-buffer.cpp:2:
/home/dronelab/slang/tools/gfx/vulkan/vk-api.h:320:5: error: ‘VkPhysicalDeviceRayTracingValidationFeaturesNV’ does not name a type; did you mean ‘VkPhysicalDeviceRayTracingMotionBlurFeaturesNV’?
  320 |     VkPhysicalDeviceRayTracingValidationFeaturesNV rayTracingValidationFeatures = {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     VkPhysicalDeviceRayTracingMotionBlurFeaturesNV
In file included from /home/dronelab/slang/tools/gfx/vulkan/vk-base.h:10,
                 from /home/dronelab/slang/tools/gfx/vulkan/vk-command-queue.h:4,
                 from /home/dronelab/slang/tools/gfx/vulkan/vk-command-queue.cpp:2:
/home/dronelab/slang/tools/gfx/vulkan/vk-api.h:320:5: error: ‘VkPhysicalDeviceRayTracingValidationFeaturesNV’ does not name a type; did you mean ‘VkPhysicalDeviceRayTracingMotionBlurFeaturesNV’?
  320 |     VkPhysicalDeviceRayTracingValidationFeaturesNV rayTracingValidationFeatures = {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     VkPhysicalDeviceRayTracingMotionBlurFeaturesNV
In file included from /home/dronelab/slang/tools/gfx/vulkan/vk-base.h:10,
                 from /home/dronelab/slang/tools/gfx/vulkan/vk-command-encoder.h:4,
                 from /home/dronelab/slang/tools/gfx/vulkan/vk-command-encoder.cpp:2:
/home/dronelab/slang/tools/gfx/vulkan/vk-api.h:320:5: error: ‘VkPhysicalDeviceRayTracingValidationFeaturesNV’ does not name a type; did you mean ‘VkPhysicalDeviceRayTracingMotionBlurFeaturesNV’?
  320 |     VkPhysicalDeviceRayTracingValidationFeaturesNV rayTracingValidationFeatures = {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     VkPhysicalDeviceRayTracingMotionBlurFeaturesNV
In file included from /home/dronelab/slang/tools/gfx/vulkan/vk-base.h:10,
                 from /home/dronelab/slang/tools/gfx/vulkan/vk-device.h:4,
                 from /home/dronelab/slang/tools/gfx/vulkan/vk-device.cpp:2:
/home/dronelab/slang/tools/gfx/vulkan/vk-api.h:320:5: error: ‘VkPhysicalDeviceRayTracingValidationFeaturesNV’ does not name a type; did you mean ‘VkPhysicalDeviceRayTracingMotionBlurFeaturesNV’?
  320 |     VkPhysicalDeviceRayTracingValidationFeaturesNV rayTracingValidationFeatures = {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     VkPhysicalDeviceRayTracingMotionBlurFeaturesNV
make[2]: *** [CMakeFiles/gfx.dir/build.make:762: CMakeFiles/gfx.dir/tools/gfx/vulkan/vk-descriptor-allocator.cpp.o] Error 1
/home/dronelab/slang/tools/gfx/vulkan/vk-device.cpp: In member function ‘gfx::Result gfx::vk::DeviceImpl::initVulkanInstanceAndDevice(const gfx::InteropHandle*, bool)’:
/home/dronelab/slang/tools/gfx/vulkan/vk-device.cpp:533:26: error: ‘struct gfx::VulkanExtendedFeatureProperties’ has no member named ‘rayTracingValidationFeatures’; did you mean ‘rayTracingPipelineFeatures’?
  533 |         extendedFeatures.rayTracingValidationFeatures.pNext = deviceFeatures2.pNext;
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                          rayTracingPipelineFeatures
/home/dronelab/slang/tools/gfx/vulkan/vk-device.cpp:534:51: error: ‘struct gfx::VulkanExtendedFeatureProperties’ has no member named ‘rayTracingValidationFeatures’; did you mean ‘rayTracingPipelineFeatures’?
  534 |         deviceFeatures2.pNext = &extendedFeatures.rayTracingValidationFeatures;
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                   rayTracingPipelineFeatures
/home/dronelab/slang/tools/gfx/vulkan/vk-device.cpp:722:59: error: ‘struct gfx::VulkanExtendedFeatureProperties’ has no member named ‘rayTracingValidationFeatures’; did you mean ‘rayTracingPipelineFeatures’?
  722 |         if(enableRayTracingValidation && extendedFeatures.rayTracingValidationFeatures.rayTracingValidation)
      |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                           rayTracingPipelineFeatures
/home/dronelab/slang/tools/gfx/vulkan/vk-device.cpp:725:34: error: ‘struct gfx::VulkanExtendedFeatureProperties’ has no member named ‘rayTracingValidationFeatures’; did you mean ‘rayTracingPipelineFeatures’?
  725 |                 extendedFeatures.rayTracingValidationFeatures,
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dronelab/slang/tools/gfx/vulkan/vk-device.cpp:590:36: note: in definition of macro ‘SIMPLE_EXTENSION_FEATURE’
  590 |             if(addFeatureExtension(s.m, s, e)) \
      |                                    ^
/home/dronelab/slang/tools/gfx/vulkan/vk-device.cpp:725:34: error: ‘struct gfx::VulkanExtendedFeatureProperties’ has no member named ‘rayTracingValidationFeatures’; did you mean ‘rayTracingPipelineFeatures’?
  725 |                 extendedFeatures.rayTracingValidationFeatures,
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dronelab/slang/tools/gfx/vulkan/vk-device.cpp:590:41: note: in definition of macro ‘SIMPLE_EXTENSION_FEATURE’
  590 |             if(addFeatureExtension(s.m, s, e)) \
      |                                         ^
/home/dronelab/slang/tools/gfx/vulkan/vk-device.cpp:727:17: error: ‘VK_NV_RAY_TRACING_VALIDATION_EXTENSION_NAME’ was not declared in this scope; did you mean ‘VK_NV_RAY_TRACING_MOTION_BLUR_EXTENSION_NAME’?
  727 |                 VK_NV_RAY_TRACING_VALIDATION_EXTENSION_NAME,
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dronelab/slang/tools/gfx/vulkan/vk-device.cpp:590:44: note: in definition of macro ‘SIMPLE_EXTENSION_FEATURE’
  590 |             if(addFeatureExtension(s.m, s, e)) \
      |                                            ^
make[2]: *** [CMakeFiles/gfx.dir/build.make:706: CMakeFiles/gfx.dir/tools/gfx/vulkan/vk-buffer.cpp.o] Error 1
make[2]: *** [CMakeFiles/gfx.dir/build.make:748: CMakeFiles/gfx.dir/tools/gfx/vulkan/vk-command-queue.cpp.o] Error 1
make[2]: *** [CMakeFiles/gfx.dir/build.make:720: CMakeFiles/gfx.dir/tools/gfx/vulkan/vk-command-buffer.cpp.o] Error 1
make[2]: *** [CMakeFiles/gfx.dir/build.make:734: CMakeFiles/gfx.dir/tools/gfx/vulkan/vk-command-encoder.cpp.o] Error 1
make[2]: *** [CMakeFiles/gfx.dir/build.make:790: CMakeFiles/gfx.dir/tools/gfx/vulkan/vk-device.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1249: CMakeFiles/gfx.dir/all] Error 2
OS: Ubuntu 20.04.6 LTS
libvulkan1/focal,now 1.2.131.2-1 amd64

Computer 2:

[ 79%] Building CXX object source/slang/CMakeFiles/slang.dir/slang-syntax.cpp.o
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp: In function ‘bool Slang::getOpInfo(const SpvOp&, SPIRVCoreGrammarInfo::OpInfo&)’:
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:4524:14: error: ‘SpvOpImageBlockMatchWindowSSDQCOM’ was not declared in this scope; did you mean ‘SpvOpImageBlockMatchSSDQCOM’?
 4524 |         case SpvOpImageBlockMatchWindowSSDQCOM:
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              SpvOpImageBlockMatchSSDQCOM
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:4530:14: error: ‘SpvOpImageBlockMatchWindowSADQCOM’ was not declared in this scope; did you mean ‘SpvOpImageBlockMatchSADQCOM’?
 4530 |         case SpvOpImageBlockMatchWindowSADQCOM:
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              SpvOpImageBlockMatchSADQCOM
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:4536:14: error: ‘SpvOpImageBlockMatchGatherSSDQCOM’ was not declared in this scope; did you mean ‘SpvOpImageBlockMatchSSDQCOM’?
 4536 |         case SpvOpImageBlockMatchGatherSSDQCOM:
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              SpvOpImageBlockMatchSSDQCOM
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:4542:14: error: ‘SpvOpImageBlockMatchGatherSADQCOM’ was not declared in this scope; did you mean ‘SpvOpImageBlockMatchSADQCOM’?
 4542 |         case SpvOpImageBlockMatchGatherSADQCOM:
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              SpvOpImageBlockMatchSADQCOM
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:4632:14: error: ‘SpvOpGroupNonUniformQuadAllKHR’ was not declared in this scope; did you mean ‘SpvOpGroupNonUniformQuadSwap’?
 4632 |         case SpvOpGroupNonUniformQuadAllKHR:
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              SpvOpGroupNonUniformQuadSwap
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:4638:14: error: ‘SpvOpGroupNonUniformQuadAnyKHR’ was not declared in this scope; did you mean ‘SpvOpGroupNonUniformQuadSwap’?
 4638 |         case SpvOpGroupNonUniformQuadAnyKHR:
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              SpvOpGroupNonUniformQuadSwap
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:5029:14: error: ‘SpvOpRawAccessChainNV’ was not declared in this scope; did you mean ‘SpvOpPtrAccessChain’?
 5029 |         case SpvOpRawAccessChainNV:
      |              ^~~~~~~~~~~~~~~~~~~~~
      |              SpvOpPtrAccessChain
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:6547:14: error: ‘SpvOpMaskedGatherINTEL’ was not declared in this scope
 6547 |         case SpvOpMaskedGatherINTEL:
      |              ^~~~~~~~~~~~~~~~~~~~~~
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:6553:14: error: ‘SpvOpMaskedScatterINTEL’ was not declared in this scope
 6553 |         case SpvOpMaskedScatterINTEL:
      |              ^~~~~~~~~~~~~~~~~~~~~~~
[ 79%] Building CXX object source/slang/CMakeFiles/slang.dir/slang-type-layout.cpp.o
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp: In function ‘bool Slang::getOpName(const SpvOp&, UnownedStringSlice&)’:
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:8477:14: error: ‘SpvOpImageBlockMatchWindowSSDQCOM’ was not declared in this scope; did you mean ‘SpvOpImageBlockMatchSSDQCOM’?
 8477 |         case SpvOpImageBlockMatchWindowSSDQCOM:
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              SpvOpImageBlockMatchSSDQCOM
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:8482:14: error: ‘SpvOpImageBlockMatchWindowSADQCOM’ was not declared in this scope; did you mean ‘SpvOpImageBlockMatchSADQCOM’?
 8482 |         case SpvOpImageBlockMatchWindowSADQCOM:
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              SpvOpImageBlockMatchSADQCOM
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:8487:14: error: ‘SpvOpImageBlockMatchGatherSSDQCOM’ was not declared in this scope; did you mean ‘SpvOpImageBlockMatchSSDQCOM’?
 8487 |         case SpvOpImageBlockMatchGatherSSDQCOM:
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              SpvOpImageBlockMatchSSDQCOM
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:8492:14: error: ‘SpvOpImageBlockMatchGatherSADQCOM’ was not declared in this scope; did you mean ‘SpvOpImageBlockMatchSADQCOM’?
 8492 |         case SpvOpImageBlockMatchGatherSADQCOM:
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              SpvOpImageBlockMatchSADQCOM
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:8567:14: error: ‘SpvOpGroupNonUniformQuadAllKHR’ was not declared in this scope; did you mean ‘SpvOpGroupNonUniformQuadSwap’?
 8567 |         case SpvOpGroupNonUniformQuadAllKHR:
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              SpvOpGroupNonUniformQuadSwap
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:8572:14: error: ‘SpvOpGroupNonUniformQuadAnyKHR’ was not declared in this scope; did you mean ‘SpvOpGroupNonUniformQuadSwap’?
 8572 |         case SpvOpGroupNonUniformQuadAnyKHR:
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |              SpvOpGroupNonUniformQuadSwap
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:8902:14: error: ‘SpvOpRawAccessChainNV’ was not declared in this scope; did you mean ‘SpvOpPtrAccessChain’?
 8902 |         case SpvOpRawAccessChainNV:
      |              ^~~~~~~~~~~~~~~~~~~~~
      |              SpvOpPtrAccessChain
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:10167:14: error: ‘SpvOpMaskedGatherINTEL’ was not declared in this scope
10167 |         case SpvOpMaskedGatherINTEL:
      |              ^~~~~~~~~~~~~~~~~~~~~~
/home/amai/slang/source/slang/slang-spirv-core-grammar-embed.cpp:10172:14: error: ‘SpvOpMaskedScatterINTEL’ was not declared in this scope
10172 |         case SpvOpMaskedScatterINTEL:
      |              ^~~~~~~~~~~~~~~~~~~~~~~
[ 79%] Building CXX object source/slang/CMakeFiles/slang.dir/slang-type-system-shared.cpp.o
[ 79%] Building CXX object source/slang/CMakeFiles/slang.dir/slang-value-reflect.cpp.o
make[2]: *** [source/slang/CMakeFiles/slang.dir/build.make:3100: source/slang/CMakeFiles/slang.dir/slang-spirv-core-grammar-embed.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:4961: source/slang/CMakeFiles/slang.dir/all] Error 2
OS: Manjaro
extra/vulkan-intel 1:24.0.8-1 (4.1 MiB 30.6 MiB) (Installed: 1:24.0.2-1)
    Open-source Vulkan driver for Intel GPUs
extra/vulkan-tools 1.3.269-1 (274.7 KiB 1.4 MiB) [vulkan-devel] 
    Vulkan Utilities and Tools
extra/vulkan-headers 1:1.3.285-1 (1.2 MiB 26.1 MiB) [vulkan-devel] (Installed: 1:1.3.279-1)
    Vulkan header files

Not super interested in using SPIRV and Vulkan, can I disable the compilation for these files?

expipiplus1 commented 1 month ago

The short answer is that it's not currently possible to toggle vulkan support.

Strange, it shouldn't even be looking at the system vulkan headers, and should be getting them from the external/vulkan directory (and just to check, is the submodule up to date?)

Can you build with --verbose please and we can see what compiler invocation is causing this?

For example on my machine:

g++ -DGFX_ENABLE_CUDA -DNOMINMAX -DSLANG_DYNAMIC -DSLANG_ENABLE_XLIB -DSLANG_GFX_DYNAMIC -DSLANG_GFX_DYNAMIC_EXPORT -DUNICODE -DVC_EXTRALEAN -DWIN32_LEAN_AND_MEAN -D_DEBUG -D_UNICODE -Dgfx_EXPORTS -DCMAKE_INTDIR=\"Debug\" -I/home/e/work/slang -I/home/e/work/slang/source -I/home/e/work/slang/external/vulkan/include -I/home/e/work/slang/external/metal-cpp -g -fPIC -fvisibility=hidden -Wall -Wno-switch -Wno-parentheses -Wno-unused-local-typedefs -Wno-class-memaccess -Wno-reorder -Wno-invalid-offsetof -Werror=return-local-addr -Wnarrowing -Wno-unused-variable -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-value -Wno-unused-but-set-variable -Wno-implicit-fallthrough -Wno-missing-field-initializers -Wno-strict-aliasing -Wno-maybe-uninitialized -MD -MT CMakeFiles/gfx.dir/Debug/tools/gfx/vulkan/vk-api.cpp.o -MF CMakeFiles/gfx.dir/Debug/tools/gfx/vulkan/vk-api.cpp.o.d -o CMakeFiles/gfx.dir/Debug/tools/gfx/vulkan/vk-api.cpp.o -c /home/e/work/slang/tools/gfx/vulkan/vk-api.cpp

has: -I/home/e/work/slang/external/vulkan/include

ArielG-NV commented 1 month ago

VkPhysicalDeviceRayTracingValidationFeaturesNV was added in the latest(?) vulkan SDK, likely has todo with versioning of not using the latest vulkan SDK.

csyonghe commented 1 month ago

This is caused by out dated vulkan headers. Slang do not use the vulkan headers from system dir or from vulkan sdk installation dir, and will use it through a submodule. I would make sure the submodule is properly updated.

bmillsNV commented 1 month ago

Closing for now. Please re-open if this is still an issue for you.