I’m currently trying to compile blender on linux which had me end up confused and I have not been able to resolve it on my own.
Blender requires the headers upon compilation and loads optix dynamically as far as I got it - libnvoptics.so.1 in specific.
Now as I found out this library is shipped together with the driver since optix v7 or similar. At first I thought I could download opticx from the website have blender compile against the headers and compile optix on my own to provide the shared library, however, libnvoptix.so.1 is not one of the outcomes rather libglad, libglfw libimgui and so on.
Since im now using headers from the downloaded files (8.0.0), the shared library from the system (driver v550.120) everything is failing probably because they are built with different compiler versions, or the headers are from a different optix version than from the driver.
Does somebody have an idea on how I could resolve this? For example I could think of the followingÖ Find out which optix version the library belongs to that I have and get the corresponding headers OR on how to build libnvoptix on my own OR where to get the headers for the library that is shipped with my driver? Or maybe there are more alternatives?
im using ubuntu 24.04, rtx4070, nvidia driver 550.120, cuda 12, gcc/++12
I investigated a bit further and did the following:
compiling the optix examples and running them (optixHello). This yields the exact same error as running it in blender Caught exception: OPTIX_ERROR_UNKNOWN: Optix call 'optixDeviceContextCreate( cuCtx, &options, &context )' failed: /optix_8.0.0/SDK/optixHello/optixHello.cpp:126)
I wrote a simple cuda kernel to check if the initialization of cuda is the problem but thatone runs like butter
Those are smart debugging steps, thanks for including them. As you mentioned, any version of OptiX 7.0 and above will using only OptiX headers from the SDK, and the shared library is provided by the driver automatically. This means if an OptiX SDK sample builds but fails to initialize, it must be a problem with the driver or a version mismatch somewhere. Let’s get your optixHello sample to run first, it’s uncommon for CUDA to run but OptiX to fail initialization, and that tends to suggest a driver issue. Problems with the driver can include a corrupted install, a bad runtime state, or mismatched version. I might be missing something but I don’t immediately see any mismatched version numbers in your setup, and I assume your problem is sticky across reboots. You’re not using docker or any other virtual environment, I assume? The first thing to try is to install one of the more recent drivers, 560 or 565. These are available from the driver download page under the ‘New Feature’, ‘Beta’, or ‘All’ tabs. You can optionally remove the old driver if you want to try a clean install. https://docs.nvidia.com/datacenter/tesla/driver-installation-guide/#removing-nvidia-driver
Thanks for your reply. Reading my initial post again I realized that I missed some crucial information: yes, im using docker. To be more specific im copying over the shared library libnvoptix.so.1 from the host into the docker image. The thought was that in this case the nvidia driver and the optix library im using are the same. Im using the follwing command then to run it right now docker run --gpus all -it blend_build bash → so it should be using the driver from the host.
This is my docker file to make it more transparent (sorry it is still in its primal form):
Thanks a lot! Once I copied over the rtcore library it works!
I have a follow up question: blender asks for the header files of optix for compilation. Now I downloaded the version 8.0.0 → are those header files compatible with all libnvoptix that come with the driver? I could imagine a mismatch of defined symbols if the wrong version is taken?
If so how can I find out the compatible ones?
The driver currently works with all OptiX headers from 7.0 on. The main thing to pay attention to is which version of the OptiX SDK Blender used, and make sure you use the same SDK version.