Coder Social home page Coder Social logo

Comments (11)

rajashekarkasturi avatar rajashekarkasturi commented on June 14, 2024 1

There seems to be some issue with path for 'glslangValidator', I think I didn't set it properly.

COMMAND ${Vulkan_GLSLANG_VALIDATOR_EXECUTABLE} --target-env vulkan1.2 -o

so I changed to glslc

COMMAND ${Vulkan_GLSLC_EXECUTABLE} --target-env=vulkan1.2 -o

It generated shaders successfully, Thanks!

from vulkan_ray_tracing_minimal_abstraction.

WilliamLewww avatar WilliamLewww commented on June 14, 2024 1

Perfect! Glad to hear it's working now! πŸ˜„

from vulkan_ray_tracing_minimal_abstraction.

WilliamLewww avatar WilliamLewww commented on June 14, 2024

Oh, I think this might be an issue where the application can't find the shader files but it does seem like you are running ./application inside the build directory.

Could you check to see if the shader files are present in your build directory (after compiling)?

This is what my build directory looks like after compilation:

build/
β”œβ”€β”€ application
β”œβ”€β”€ CMakeCache.txt
β”œβ”€β”€ CMakeFiles
β”‚Β Β  β”œβ”€β”€ 3.23.1
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CMakeCCompiler.cmake
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CMakeCXXCompiler.cmake
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CMakeDetermineCompilerABI_C.bin
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CMakeDetermineCompilerABI_CXX.bin
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CMakeSystem.cmake
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CompilerIdC
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ a.out
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CMakeCCompilerId.c
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── tmp
β”‚Β Β  β”‚Β Β  └── CompilerIdCXX
β”‚Β Β  β”‚Β Β      β”œβ”€β”€ a.out
β”‚Β Β  β”‚Β Β      β”œβ”€β”€ CMakeCXXCompilerId.cpp
β”‚Β Β  β”‚Β Β      └── tmp
β”‚Β Β  β”œβ”€β”€ 3.23.2
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CMakeCCompiler.cmake
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CMakeCXXCompiler.cmake
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CMakeDetermineCompilerABI_C.bin
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CMakeDetermineCompilerABI_CXX.bin
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CMakeSystem.cmake
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CompilerIdC
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ a.out
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CMakeCCompilerId.c
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── tmp
β”‚Β Β  β”‚Β Β  └── CompilerIdCXX
β”‚Β Β  β”‚Β Β      β”œβ”€β”€ a.out
β”‚Β Β  β”‚Β Β      β”œβ”€β”€ CMakeCXXCompilerId.cpp
β”‚Β Β  β”‚Β Β      └── tmp
β”‚Β Β  β”œβ”€β”€ application.dir
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ build.make
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ cmake_clean.cmake
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ compiler_depend.internal
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ compiler_depend.make
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ compiler_depend.ts
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ DependInfo.cmake
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ depend.make
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ flags.make
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ link.txt
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ progress.make
β”‚Β Β  β”‚Β Β  └── src
β”‚Β Β  β”‚Β Β      β”œβ”€β”€ main.cpp.o
β”‚Β Β  β”‚Β Β      └── main.cpp.o.d
β”‚Β Β  β”œβ”€β”€ cmake.check_cache
β”‚Β Β  β”œβ”€β”€ CMakeDirectoryInformation.cmake
β”‚Β Β  β”œβ”€β”€ CMakeOutput.log
β”‚Β Β  β”œβ”€β”€ CMakeRuleHashes.txt
β”‚Β Β  β”œβ”€β”€ CMakeTmp
β”‚Β Β  β”œβ”€β”€ copy_resources.dir
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ build.make
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ cmake_clean.cmake
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ compiler_depend.make
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ compiler_depend.ts
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ DependInfo.cmake
β”‚Β Β  β”‚Β Β  └── progress.make
β”‚Β Β  β”œβ”€β”€ Makefile2
β”‚Β Β  β”œβ”€β”€ Makefile.cmake
β”‚Β Β  β”œβ”€β”€ progress.marks
β”‚Β Β  └── TargetDirectories.txt
β”œβ”€β”€ cmake_install.cmake
β”œβ”€β”€ Makefile
β”œβ”€β”€ resources
β”‚Β Β  β”œβ”€β”€ cube_scene.mtl
β”‚Β Β  └── cube_scene.obj
└── shaders
    β”œβ”€β”€ shader.rchit.spv
    β”œβ”€β”€ shader.rgen.spv
    β”œβ”€β”€ shader.rmiss.spv
    └── shader_shadow.rmiss.spv

from vulkan_ray_tracing_minimal_abstraction.

rajashekarkasturi avatar rajashekarkasturi commented on June 14, 2024

Hi William as you mentioned, ran the ./application in the build directory but could not find the shaders in the shaders/ folder.

from vulkan_ray_tracing_minimal_abstraction.

WilliamLewww avatar WilliamLewww commented on June 14, 2024

It seems like there might be an issue when trying to compile the shaders. Here is what my output looks like when building the project:

[wlew@archlinux:/storage/projects/vulkan_ray_tracing_minimal_abstraction/ray_pipeline/build]$ cmake ..
-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Vulkan: /storage/projects/vulkan_research_kit/tools/vulkan_development/install/lib/libvulkan.so (found version "1.3.204") 
-- Configuring done
-- Generating done
-- Build files have been written to: /storage/projects/vulkan_ray_tracing_minimal_abstraction/ray_pipeline/build

[wlew@archlinux:/storage/projects/vulkan_ray_tracing_minimal_abstraction/ray_pipeline/build]$ make
[  0%] Built target copy_resources
[ 16%] Generating shaders/shader_shadow.rmiss.spv
/storage/projects/vulkan_ray_tracing_minimal_abstraction/ray_pipeline/src/shader_shadow.rmiss
[ 33%] Generating shaders/shader.rchit.spv
/storage/projects/vulkan_ray_tracing_minimal_abstraction/ray_pipeline/src/shader.rchit
[ 50%] Generating shaders/shader.rgen.spv
/storage/projects/vulkan_ray_tracing_minimal_abstraction/ray_pipeline/src/shader.rgen
[ 66%] Generating shaders/shader.rmiss.spv
/storage/projects/vulkan_ray_tracing_minimal_abstraction/ray_pipeline/src/shader.rmiss
[ 83%] Building CXX object CMakeFiles/application.dir/src/main.cpp.o
[100%] Linking CXX executable application
[100%] Built target application

Since the shaders are missing from your build, I'm assuming that it doesn't show the Generating shaders/______.spv output when building.

Could you check to see if you have the glslangValidator program?

from vulkan_ray_tracing_minimal_abstraction.

rajashekarkasturi avatar rajashekarkasturi commented on June 14, 2024

glslangValidator is present! in /usr/bin/glslangValidator

:~/Desktop/sample/vulkan_ray_tracing_minimal_abstraction/ray_pipeline/build$ make
[  0%] Built target copy_resources
[ 16%] Generating shaders/shader_shadow.rmiss.spv
make[2]: target-env: Command not found
[ 33%] Generating shaders/shader.rchit.spv
make[2]: target-env: Command not found
[ 50%] Generating shaders/shader.rgen.spv
make[2]: target-env: Command not found
[ 66%] Generating shaders/shader.rmiss.spv
make[2]: target-env: Command not found
[ 83%] Building CXX object CMakeFiles/application.dir/src/main.cpp.o
[100%] Linking CXX executable application
[100%] Built target application

from vulkan_ray_tracing_minimal_abstraction.

WilliamLewww avatar WilliamLewww commented on June 14, 2024

It seems like the cmake find_package(Vulkan REQUIRED) isn't properly setting the Vulkan_GLSLANG_VALIDATOR_EXECUTABLE variable properly.

COMMAND ${Vulkan_GLSLANG_VALIDATOR_EXECUTABLE} --target-env vulkan1.2 -o
shaders/${SHADER_NAME}.spv ${SHADER}

For now, a temporary solution is to change ${Vulkan_GLSLANG_VALIDATOR_EXECUTABLE} to glslangValidator so that the shaders can compile using the program.

I'm going to update the cmake_minimum_required version to 3.21 to ensure the Vulkan::glslangValidator target is imported.

https://cmake.org/cmake/help/latest/module/FindVulkan.html

from vulkan_ray_tracing_minimal_abstraction.

rajashekarkasturi avatar rajashekarkasturi commented on June 14, 2024

Hi @WilliamLewww

When I'm running the ./application. It is showing a blank screen "Vulkan not Responding" as popup and force quitting the application.

This is the console output

Validation Information: [ UNASSIGNED-khronos-validation-createinstance-status-message ] Object 0: handle = 0x1034650, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xd7fa5f44 | Khronos Validation Layer Active:
Β Β Β  Settings File: None. Default location is /home/sample/vulkan_ray_tracing_minimal_abstraction/ray_pipeline/build\vk_layer_settings.txt.
Β Β Β  Current Enables: VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT, VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION.
Β Β Β  Current Disables: None. 

NVIDIA GeForce RTX 2080
killed

FYI

> ~ vulkaninfo | grep KHR_ray
WARNING: [Loader Message] Code 0 : verify_meta_layer_component_layers: Meta-layer uses API version 1.2, but component layer 0 uses API version 1.3.Β  Skipping this layer.
ERROR: [Loader Message] Code 0 : libVkLayer_MESA_device_select.so: cannot open shared object file: No such file or directory
VK_KHR_ray_queryΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  : extension revision 1
VK_KHR_ray_tracing_pipelineΒ Β Β Β Β Β Β Β Β Β Β Β Β Β  : extension revision 1

I'm in a doubt that, is it causing error because of Vulkan 1.3 version?

from vulkan_ray_tracing_minimal_abstraction.

WilliamLewww avatar WilliamLewww commented on June 14, 2024

Hmm I don't think the 1.3 should be an issue.

I think it might be hanging on the main loop. If possible could you write a print statement right before the main loop here:

// =========================================================================
// Main Loop

My guess is there might be a bug with the semaphores/fences when trying to acquire a new image.

from vulkan_ray_tracing_minimal_abstraction.

rajashekarkasturi avatar rajashekarkasturi commented on June 14, 2024

Hi @WilliamLewww
Thanks for your patience

I added this print statement in main.cpp:

std::cout << "Debugging: Could not find Vulkan" << std::endl;

Output: Same as I got earlier: Vulkan not responding and I had to force quit the application

> vulkan_ray_tracing_minimal_abstraction/ray_pipeline/build$ ./application 
Validation Information: [ UNASSIGNED-khronos-validation-createinstance-status-message ] Object 0: handle = 0x5a1820, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xd7fa5f44 | Khronos Validation Layer Active:
Β Β Β  Settings File: None. Default location is /vulkan_ray_tracing_minimal_abstraction/ray_pipeline/build\vk_layer_settings.txt.
Β Β Β  Current Enables: VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT, VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION.
Β Β Β  Current Disables: None. 

NVIDIA GeForce RTX 2080
Killed

from vulkan_ray_tracing_minimal_abstraction.

WilliamLewww avatar WilliamLewww commented on June 14, 2024

Sorry for the late response, my notifications seem to not be working at the moment.

Hmmm it seems like it's hanging on a specific stage. To try to debug it, you could probably add a print statement at the start of each section.

In this case, it might be useful in general to have a printout for every section so I'll try to open a pull request with the print statements.

from vulkan_ray_tracing_minimal_abstraction.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.