OptiX Error: 'Failed to load OptiX library

I run those two executes from directory SDK-precompiled-samples and I export LD_LIBRARY_PATH as SDK-precompiled-samples otherwise it can not find libsutil_sdk.so. I am trying to use strace.

I build the SDK on local machine and run $ strace ./optixRaycasting. It tells that libnvoptix-sdk.so.1 is missing. And the ending part of strace output is :

open(“tls/libnvoptix-sdk.so.1”, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(“x86_64/libnvoptix-sdk.so.1”, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(“libnvoptix-sdk.so.1”, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(“/etc/ld.so.cache”, O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=214066, …}) = 0
mmap(NULL, 214066, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2af878baa000
close(3) = 0
access(“/etc/ld.so.nohwcap”, F_OK) = -1 ENOENT (No such file or directory)
open(“/lib/x86_64-linux-gnu/libnvoptix-sdk.so.1”, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(“/usr/lib/x86_64-linux-gnu/libnvoptix-sdk.so.1”, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(“/lib/libnvoptix-sdk.so.1”, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open(“/usr/lib/libnvoptix-sdk.so.1”, O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
munmap(0x2af878baa000, 214066) = 0
futex(0x2af87a26d1a0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(2, “Failed to load OptiX library”, 28) = 28
write(2, “\n”, 1) = 1
exit_group(1) = ?
+++ exited with 1 +++

I test it with another GPU RTX2070 and strace says libnvoptix-sdk.so.1 is missing but it just continued without exit.

The missing libnvoptix-sdk.so is fine. This is not a required lib. The issue is finding libnvoptix.so.1 and libnvidia-rtcore.so.VERSION. In your case, it is libnvoptix.so.1 that is missing.
So look for ‘open’ system calls that are targeted at this library. Compare the strace outputs of your working optixHello run and your failing optixRaycasting lib and see where optixHello is finding this library, and see what paths optixRaycasting is searching.

optixHello did not try to load libnvoptix.so.1 but optixRaycasting did indeed. In this machine(Ubuntu 16.04) with V100 SXM2, libnvoptix.so.1 can not be found. This machine uses driver 440.33.01.

But in another machine (Ubuntu 18.04LTS) with RTX2070, driver 440.64, libnvoptix.so.1 locates in /usr/lib/x86_64-linux-gnu/

My question is: If every nvidia driver 440 should contain libnvoptix.so.1?
If so, I should re-install driver for V100 SXM2 until a proper driver installation gives me this lib

I am a bit confused by why optixHello is not loading the nvoptix lib – I will look into that later.

However, the issue is a bit clearer now - I did not note the fact that you are using a Tesla system. There is a known issue with finding the raytracing libs on tesla systems. The lib is installed, but the optix wrapper lib does not look for it in the correct place.

If you can find the libnvoptix.so.1 lib, you can add its location to your LD_LIBRARY_PATH and should be fine. I will inquire on my end and find more info on where this lib is typically installed in the tesla driver.

Is this issue dead. I am having same problem with K80 card, with Nvidia 418 driver, I am trying to use this on Ubuntu 18.04 instance on google cloud. Which debian package proivdes this libnvoptix.so.1

Much appreciate your help on this

  • First, an NVIDIA Tesla K80 is a Kepler based GPU. That GPU architecture is not supported by OptiX since version 6.0.0. Means your system setup is limited to OptiX 5.1 and older versions.
  • Versions 6.0.0 and before would not have this issue with driver components because the OptiX core implementation is not residing inside the display drivers. See posts above.
  • If you had a Maxwell or newer GPU, OptiX 6.5.0 or newer is not supported by 418 drivers. Please always refer to the OptiX release notes directly under the resp. OptiX download button on developer.nvidia.com.
  • (A similar issue under Windows 10 based OSes with all GPUs in the TCC driver mode where not all required driver components could be found with OptiX 6.5.0 and higher has been fixed inside the 450 driver releases. See versions in the OptiX 7.1.0 Release Notes.)

Hello! I have the Optix SDK 7.1.0 for Windows. Trying to use it with Nvidia 452.39 on 3ds Max 2021 with Arnold renderer. Getting the error “Nvidia 452.39 is too old or missing the Optix library”. I’ve reinstalled the SDK twice, still not working. What am I doing wrong?

I’m trying to run it on a Nvidia Quadro P2000 (notebook), which should be meeting the requirements right?

First of all, there is no need to install an OptiX SDK for running any commercial application which is using OptiX.
The OptiX SDK is only required during application development.

The application itself needs to ship the required libraries and the target system needs to have a display driver version installed which the application requires. That’s all.

There is a knowledge base article about exactly that already:
https://knowledge.autodesk.com/support/3ds-max/troubleshooting/caas/sfdcarticles/sfdcarticles/GPU-rendering-with-Arnold-does-not-work-in-3ds-Max.html

If that doesn’t help, you could try refreshing/changing the display drivers and install them cleanly.
Means, download the newest available NVIDIA display drivers for your board.
Then first uninstall your current NVIDIA display drivers with Windows’ “Add or Remove Programs” and reboot.
Then start the NVIDIA display driver installer and select “Custom” and check the “Clean Installation” box.
When that is done, verify if the NVIDIA Display Control Panel works.

Other than that, we’ve seen one issue where an NVIDIA nvml.dll resided inside a 3ds Max installation, but I don’t know how it got there. That DLL doesn’t belong there. It must use the one shipping with the display driver.

You should definitely visit the Autodesk 3ds Max support forum instead. Just searching for “Arnold OptiX” there turned up all things I said above.
https://forums.autodesk.com/t5/3ds-max/ct-p/area-c1

Hi,

I also get the same error. I am on Ubuntu 18.04. My Driver Version is 455.23.04, cuda version is CUDA Version: 11.1, and GPU is RTX3080.

I am trying to run the code in optix_advanced_samples. I tried Optix 5.0, 6.0, 6.5, but always get the error:

terminate called after throwing an instance of ‘optix::Exception’ what(): Failed to load OptiX library.

I then use strace (Optix 6.5) to check the error. It returns a lot of errors, and I show a part of them here:

By the way, I have two versions of cuda (10.2 and 11.1) in my machine since optix_advanced_samples only support sm_30. So I install cuda 10.2 in my system. The output of nvcc --version is cuda 10.2, while the output of nvidia-smi is cuda 11.1. Not sure if it is related to this error.

Could you please help me work out this error. Thank you in advance!

Did you try all recommendations in this thread above?

Check if and where the required display driver libraries are located on your system.
If they are not found, maybe try reinstalling the official NVIDIA display drivers.
I would recommend the 455.28 version under Linux because they support OptiX SDK 7.2.0 as well. (Windows needs 456.71 for that.)

The old advanced examples are written against the OptiX SDK 5.1.0 but I made them compile and work with up to OptiX SDK 6.5.0.
They are not using your RTX board’s hardware triangle intersection routine because that requires explicit use of the GeometryTriangles and that didn’t exist before OptiX 6.0.0 and as such are not representative of the possible performance.
I’ve ported some of the OptiX Introduction examples in there to OptiX 7. Find the links inside the sticky posts of this OptiX sub-forum.

CUDA 11.0 removed support for the Streaming Multiprocessor (SM) versions SM 3.0 and 3.2 for Kepler and deprecated the SM 3.5, 3.7 (Kepler and SM 5.0 (Maxwell) support.

If you want to compile code for SM 3.0 you should use a CUDA version below 11.0, like any CUDA 10.x versions.
Since OptiX 6.0.0 aren’t support Kepler GPUs anymore, the examples can be changed to compile against SM 5.0 (Maxwell) which would generate deprecation warnings with CUDA 11, which can be suppressed with the “-Wno-deprecated-gpu-targets” NVCC command line option.
Or you can use SM 6.0 (Pascal), if you do not need to support older GPUs with your OptiX application, to avoid these deprecation warning in CUDA 11.x…

Inside the old advanced examples, this should be the place you need to change:
https://github.com/nvpro-samples/optix_advanced_samples/blob/master/src/CMakeLists.txt#L150

The output of nvcc --version is cuda 10.2, while the output of nvidia-smi is cuda 11.1.

nvidia-smi reports which highest CUDA version the installed CUDA driver is supporting. R455 driver are supporting 11.1 which is as expected.

Finally, I would not recommend starting new OptiX projects with OptiX SDK versions before OptiX 7.0.0.
Please read the OptiX 7 related topics on this forum for more information.

Hi,

Thank you for your quick reply. I am sorry that not familiar with computer graphics and nvidia driver. I am actually a computer vision researcher. I am trying to run the code in this research, and they said that the requirement of building their optix renderer is the same as you. So I may need to follow the requirement of your code, which supports sm_30. So in this case, I may not be able to use Optix 7.

For the required library, do you mean something like libnvoptix-sdk.so? Could you please tell me how can I check this problem?

I use cuda 10.2 to complie the optix successfully, do I still need to change the place you mentioned?

By the way, I recomplied your github code with Optix 5.0, but get the error:

terminate called after throwing an instance of ‘optix::Exception’
what(): Unknown error (Details: Function “RTresult _rtBufferCreate(RTcontext, unsigned int, RTbuffer_api**)” caught exception: Assertion failed: “rtcRes == RTC_SUCCESS”, file: /root/sw/wsapps/raytracing/rtsdk/rel5.0/src/Device/CUDADevice.cpp, line: 180)
Aborted (core dumped)

Any suggestions please? Thank you very much!!!

Should I compile your code with cuda 11.1 with the change of the flag “sm_30” since I am using the driver that supporting cuda 11.1? I guess this should not work, but just to make sure. I am new to this area, I am sorry for these easy questions.

Thank you!

For OptiX it’s enough to compile the input PTX code to the minimum SM version you need to support.
That is generally done for the minimum supported SM target per OptiX SDK version.
OptiX recompiles the code anyway and generates code for the underlying GPU.
If you’re using CUDA 10.x SM 3.0 is just fine for now. It’s just that CUDA 11.x will not work for that first Kepler SM target.

Display drivers support all CUDA toolkit versions up to the one they report. Means if you use an older CUDA toolkit you cannot generate code which is not supported by a display driver reporting a newer CUDA version.
That’s not a problem. But newer CUDA toolkits cannot generate some older SM code anymore.

Please read the OptiX release Notes (link directly beneath each individual OptiX version’s download button) before setting up a development system for each OptiX SDK.
Not all combinations of OptiX, GPUs, CUDA toolkit and host compiler will work!

I’m not a Linux user. I can’t help you with configuration issues aside of what has been said in the whole thread above already.

It named the two required display driver libraries for the OptiX core implementation here
https://forums.developer.nvidia.com/t/optix-error-failed-to-load-optix-library/70671/23
and the OptiX SDK library libnvoptix-sdk.so.1 which is used to load the API entry points in OptiX 6 versions should be shipping with your OptiX SDK 6.5.0.
(I assumed the underlying library name is versioned.)

Since strace didn’t find them, your task would be to check if they are installed at all on your system.
If yes, why aren’t they found? Check the load library path advices above again.
If not, try installing an official NVIDIA Linux 64-bit display driver like 455.28.

Then first try running any of the OptiX SDK 6.5.0 examples.
The most basic one is optixDeviceQuery from a console.
The next basic one would be optixConsole. Neither need any window or OpenGL.
If those still fail to find the OptiX driver libraries, then I can’t help further.

By the way, I recomplied your github code with Optix 5.0, but get the error:

Please do not use OptiX 5.0.0 anymore. That predates your installed GPU by a lot! (See OptiX Release Notes.)
Instead try getting the old OptiX advanced samples to work with OptiX 6.5.0 first.

The OptiX versions < 6 run standalone and do not have their core implementation inside the driver, but they also don’t support your installed GPU.
I’ve not tried running OptiX 5 applications on an Ampere GPU but I wouldn’t be surprised if that is not working.
(I only wrote the OptiX Introduction examples in that repository.)

Hi,

Thank you for your reply. I will try them out and see if them work. Thank you again for your help!

Hi,

I have tried your suggestions. I update driver to 455.28, add two required libraries in OptiX Error: 'Failed to load OptiX library - #23 by Keith_Morley. And solve the error before.

Reminder: I have cuda 10.2, driver 455.28, and RTX 3080 GPU.

I can run the optixDeviceQuery and primeSimple, but when I run optixConsole here comes a new error:

terminate called after throwing an instance of ‘optix::Exception’
what(): Unknown error (Details: Function “RTresult _rtBufferCreate(RTcontext, unsigned int, RTbuffer_api**)” caught exception: Encountered a rtcore error: m_api.deviceContextCreateForCUDA( context, properties, devctx ) returned (2147483647): Unknown)
Aborted (core dumped)

I also tried compile renderer using cuda 11.1, but it still doesn’t work. Any suggestions please? Thank you!

Here is my ccmake setting:

I filed an internal bug report to have our QA try to reproduce this.

Thank you for your help!

I would like to solve it as soon as possible since there is a deadline approaching. What else can I do please? Would downgrading video card driver help? Not sure if it will have any issue for RTX 3080 with driver version older than 455.23.04

Hi @droettger, were you able to reproduce the error and figure out what’s wrong with it? Thank you!

It looks very much like you have a bad driver configuration. What method were you using to install the driver? It sounds like you used an NVIDIA-provided runscript? Were you using the package manager (apt) for the driver install before? It is fairly easy to get your driver configuration in a bad state (eg, when combining installation methods or when not properly blacklisting other driver modules such as nouveau or intel integrated drivers).

You might try starting from scratch by purging all nvidia packages via apt and running the runscript installer in --uninstall mode, then following the advice here: Installing the latest NVidia Driver, CUDA, and OptiX on Linux/Ubuntu 18.04 – Ingo's Blog

Several developers on the optix team are using Ubuntu 18.04 with optix successfully so there is hope :)