AcademySoftwareFoundation / OpenShadingLanguage

Advanced shading language for production GI renderers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optix 7 crash without first compiled material in pipeline

pellerington opened this issue · comments

This line in liboslexec/llvm_instance.cpp:

static bool added_library = false;

makes sure the lib bitcode is only added to the first generated ptx file. Having the same function in more than one module of the OptixPipeline seems to make it crash.

However this implementation is causing me some issues. For example, if the first material is removed by a user Optix can't find the osl functions. Also if the render is unloaded and loaded again at some later point the static variable will still be set to true (switching between hydra delegates).

I have a temp workaround but I think the correct solution would be to generate ptx for the lib_bitcode and add a dummy module similar to how strings used to be handled in optix 7. Could this also be done at compile time using nvcc so the clang bitcode/serialize-bc.py would no longer be nessisary?

Wanted to check if this issue was known or if there was any planned solution before I implemented anything.