Is it possible to embed optix-ir into an application, and if so, is there an example online to look at?
I have previously embeded ptx following Ingo’s examples, with bin2c, encoding the ptx as a char sting. Now I whish to migrate to optix-ir. For this I changed the nvcc flag from -ptx to --optix-ir. When compiling module I get
Program aborted due to an unhandled Error:
Invalid bitcode signature
from optixModuleCreate at runtime. Hints on how to move forward, and online examples would be appreciated.
Yes, that should just work, unless you did anything with strings, because there can be null characters inside the binary *.optixir.
So if you didn’t also adjust the optixModuleCreate function arguments throughout the code to not use things like ptxCode.c_str(), this ain’t working.
What is your display driver version?
There was an error in the optixModuleCreate function not adhering to the input code size argument correctly but that should have been fixed in current R535 drivers (535.92 and newer).
The default alignment is 1 which doesn’t need any padding for char data. Though if it post-added a null char at the end to make that array data a C string, which wouldn’t hurt for the PTX input case but isn’t required due to the explicit size argument in optixModuleCreate, it’s definitely incorrect for binary data.