Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with underscore in "_edit" dir name on Linux #12

Closed
timo-oster opened this issue Jul 26, 2021 · 4 comments
Closed

Issues with underscore in "_edit" dir name on Linux #12

timo-oster opened this issue Jul 26, 2021 · 4 comments

Comments

@timo-oster
Copy link

I'm trying to do the tutorial on Linux, but I've run into a problem when compiling the first shader file. The shader compiler is not run for the _edit project and no spv file is generated. It appears that this is caused by the underscore in the name of the directory. I was able to fix the issue by renaming the directory, or alternatively, by adding the keyword VERBATIM to the add_custom_command call in the _compile_GLSL_flags macro in nvpro_core/cmake/setup.cmake.

@NBickford-NV
Copy link
Contributor

Hi timo-oster,

Thanks, that looks like a bug, and it sounds like adding VERBATIM is the fix! I'm trying to understand the root cause of why the underscore is causing issues, though, so that we can check if there are similar issues elsewhere and avoid this in the future - do you happen to know why this might be?

On a fresh Ubuntu 20.04 running in WSL using the Makefiles generator (I haven't tested ninja on the latest version yet), it seems to create the .spv file:

[ 95%] Built target nvpro_core
[ 97%] Generating /home/nbickford/nvpro-samples/vk_mini_path_tracer/_edit/shaders/raytrace.comp.glsl.spv
/usr/bin/glslangValidator --target-env vulkan1.2 -o shaders/raytrace.comp.glsl.spv -g /home/nbickford/nvpro-samples/vk_mini_path_tracer/_edit/shaders/raytrace.comp.glsl
/home/nbickford/nvpro-samples/vk_mini_path_tracer/_edit/shaders/raytrace.comp.glsl
Scanning dependencies of target vk_mini_path_tracer__edit
[100%] Building CXX object _edit/CMakeFiles/vk_mini_path_tracer__edit.dir/main.cpp.o
[100%] Linking CXX executable /home/nbickford/nvpro-samples/bin_x64/Release/vk_mini_path_tracer__edit.exe
[100%] Built target vk_mini_path_tracer__edit

The generated Makefile appears to have the correct syntax - I can definitely spot an issue with spaces here that VERBATIM would fix, but that doesn't match up with how renaming _edit would fix it:

cd /home/nbickford/nvpro-samples/vk_mini_path_tracer/_edit && /usr/bin/glslangValidator --target-env vulkan1.2 -o shaders/raytrace.comp.glsl.spv -g /home/nbickford/nvpro-samples/vk_mini_path_tracer/_edit/shaders/raytrace.comp.glsl

I could imagine an issue with backslashes and escape sequences, but these are forward slashes; apparently some Linux GUIs display underscores as spaces, but that is probably not the problem here.

Thanks!

--Neil

@timo-oster
Copy link
Author

I tried investigating this a bit further and removed the VERBATIM keyword again. I also ran make clean and deleted the cmake build directory to start over from scratch. Strangely, the spv file is now generated even without VERBATIM. I'm a little further into the tutorial now than I was before. Not sure if that could have anything to do with it. But I can't reproduce the issue any more.

@NBickford-NV
Copy link
Contributor

Hi again Timo,

Thanks, that's good to hear! I just added something upstream (which should be arriving with the next bulk-update) that might address a similar thing - since the _edit project doesn't include the shaders directory by default (as it's empty), it's easy to create a .glsl file in _edit directly, instead of creating an _edit/shaders directory and then creating the .glsl file there. I added some additional CMake code to detect when this happens and automatically move files and create the needed folder structure.

Thanks again!

@NBickford-NV
Copy link
Contributor

Okay, the improvement mentioned in the last comment has now been integrated in commit 5cf2ea9! This should help avoid some issues with creating shaders in the _edit directory. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants