Rendering errors in Optix 7.4

Thanks for the 7.4 update!

Unfortunately, I am hitting a disappearing objects problem in the project I’m working. I’m using the exact same code that I’ve been using in OptiX 7.3 except for the OPTIX_COMPILE_DEBUG_LEVEL_MINIMAL replacement and there are no such problems in OptiX 7.3.

Any idea what may be causing this?

Windows 10 Home
Visual Studio Community 2019 version 16.11.5
GeForce RTX 2070 SUPER
Driver version 496.49
OptiX 7.4
CUDA 11.4

Oops. Cancel that. Looks like a driver problem, not a OptiX 7.4 problem. I realized I had updated the drivers too and so went back and tried with OptiX 7…3 and got the same rendering problems.

Cool video! It’s always fun to see what people are using OptiX for.

So I don’t have a theory yet for what might cause the disappearing objects, but one thing does come to mind that has come up many times as of late.

Please triple-check to make sure you are zero-initializing all OptiX structs before setting any members and then passing them to an API call. One thing that can and does happen is that code can stop working properly, even when it used to work, if the structs gain new members that are not initialized to zero. There are several such structs in OptiX 7.4 that have changed recently, and the change typically does occur in the driver before you see it in the SDK.

Empty braces “{}” are what we use in many places in the SDK samples to zero-initialize, but you can also use memcpy / memset / bzero or any other way you like. Example: OptixPipelineCompileOptions pipeline_compile_options = {}; Note that it’s not sufficient to set the individual members of the struct to zero (because that will not catch new members)!

Side note- be careful with this construct inside your shader programs, in case you’re tempted to use {} everywhere. While {} is succinct and easy to read, it’s often not as efficient as a memset, and in device code you may want to avoid initializing your structs for performance reasons. I know it’s awful to go against best code & safety practices, but zero-initializing large structs really does waste cycles and cost time in GPU code.

If that’s not the problem, and after debugging a bit it still seems like an OptiX issue, then let’s dig in further and try to find out why the objects are flashing and disappearing.


Whew, it was my bug fortunately. All fixed now and OptiX 7.4 is working fine here. Sorry for the false alarm.

I’m having a blast using OptiX. I’ve cobbled together a renderer using Shocker’s wrapper shocker-0x15 (shocker-0x15) · GitHub and some of the shading code from Yocto-gl GitHub - xelatihy/yocto-gl: Yocto/GL: Tiny C++ Libraries for Data-Driven Physically-based Graphics, which is a great resource.

After a lot of trying I’m finally getting some decent results and they only take a second to render. :)