Using relative path for Optix PTX file

I have downloaded and installed Optix 8.0 locally. I have the following path for the PTX file for raytracing after building the “OptixRayCasting” module:

“C:\ProgramData\NVIDIA Corporation\OptiX SDK 8.0.0\SDK\bin\lib\ptx\Release\optixRaycasting_generated_optixRaycasting.cu.optixir”.

The following code snippit loads the details of the “optixRaycasting_generated_optixRaycasting.cu.optixir” file into a RayCastingState:

However, the path to the “optixRaycasting_generated_optixRaycasting.cu.optixir” obtained in sutil::getInputData is absolute to the installation directory.

Is there a way to define a relative path to this file (“optixRaycasting_generated_optixRaycasting.cu.optixir”) to if it was copied elsewhere?

@dhart , do you know if this is possible?

Definitely possible, yes! sutil is just basically a set of example code intended for customization or just inspiration. Feel free to dive into it and change the way it works, fork it, rewrite it, or create your own utility functions.

FWIW, the SDK’s cmake build infrastructure is in the same boat, up for anything from tweaking to rewriting to replacing. I only mention that in case there is some cooperation between where cmake puts things and where sutil loads them from that you might need to know about, I don’t remember off the top of my head. But if you just want to hack on sutil::getInputData to pass in an additional custom directory to search, that’s fair game.


David.