We are using optix to develop a houdini rendering plugin. It was working very well previously before we upgraded to optix 7.4, however after upgrading it crashes at optixModuleCreateFromPTX quite frequently. The actual workflow to occur this problem is like
initialize everything → render → dispose everything-> initialize again → crash
This is very odd as we can’t see any memory leak or so happens and it just crashes. Everytime it crashes at optixModuleCreateFromPTX call, but sometimes it’s a memory-leak-ish exception where system memory usage gets very large, while in other cases it reports like “access to 0xFFFFFFFF failed”.
We can fix this by switching back to optix 7.1, but it’s really mysterious to us and we keep wondering why. Now I am even personally suspecting houdini causes this. Could anyone please provide some hint on this strange problem? Thanks!
It’s of course really hard to speculate on what could be wrong. We haven’t heard about this kind of a crash elsewhere, and nothing in our regression tests has picked it up.
One thing to triple-check is to make sure all your OptiX structs are zero-initialized before use. This may mean re-zeroing them when you want to re-use them. The most common cause of driver & SDK upgrade bugs we’ve seen so far is cases where we added new members to the structs and people left them uninitialized and it led to bad behavior. Also make sure to turn on OptiX validation mode.
Of course this could be a legitimate bug somewhere, so if you’re already initializing everything cleanly, then the main question is how we might be able to get our hands on a minimal reproducer.
Hi this is a late follow-up. Today I tried to find out EVERY option variable (OptixModuleCompileOptions, OptixPipelineLinkOptions, etc.) and make sure they are zero initialized, and the problem is gone. So yes it’s due to uninitialized structs. Thanks for the comment and now we can eventually enjoy the recent optix updates.