I tried this experiment on a NVIDIA GTX 560, and on a NVIDIA GTX 550 Ti.
I took the ray tracing from Sascha Willems.
https://github.com/SaschaWillems/Vulkan
I replaced the shader code by a path tracing shader.
I reused the C version for CPU from:
http://www.kevinbeason.com/smallpt/
I did 2 tests:
- A pure recursive version where the function calls itself
- A version that copy-pastes the radiance() function 8 times to make a little recursion a few times but not pure. Each function calls the next function that calls the next function.
A copy paste of 4 times will work without any problem. Therefore, the implementation in place is correct. However, if I add more copy pastes of teh function, then I get problems.
On Ubuntu LTS 16, both versions eat up all memory and freeze my mouse. Then I must restart my computer.
On Debian stable 8.6, it doesn’t freeze. It uses the swap with a nice 10 % memory left. But it takes too long.
Comment 1:
It seems to me that the drivers are not really ready to handle recursion that the SPIRV specification clearly allows for the OpFunction. It is like if this feature is not supported. Since OpenGL does not allow it, it is something new.
Questions:
–> does the NVIDIA driver support the recusion of OpFunction, in a pure way and with copy pastes?
I took the right NVIDIA prorietary driver for debian as explained in the official debian page.
–> Why is Ubuntu not using the swap efficiently when running Vulkan? It seems to me that the greedinjess on memory is so fast that the OS loses control.
–> Why does the function vkCreateComputePipelines() take so long and why does it take much RAM?
–> Is there anything I can do to make this path tracing work?
code available here:
https://app.assembla.com/spaces/magic_poulp/documents/bi8s0IZS4r5O5KacwqjQXA/download/bi8s0IZS4r5O5KacwqjQXA?notinline=true