Libnvoptix.so.1 in WSL not searched upon /usr/lib/wsl/lib

I know this is probably a confusing title for a post. Let me explain:

I acquired recently a new laptop with a 3060 RTX GPU. The machine is currently able to run CUDA applications from within Windows Subsystem for Linux with no problems so far.

I created an app that would, in addition to CUDA, use OptiX (7.5) to run a kernel in the RTX cores of the machine. I can confirm 100% that the app works fine in a remote server environment, using Ubuntu 18.04. But, the app won’t work in the laptop due to OPTIX_ERROR_LIBRARY_NOT_FOUND when invoking optixInit().

I checked, and found out that libnvoptix.so.1 and libnvoptix_loader.so.1 are currently present in the /usr/lib/wsl/lib directory, along with libcuda.so.1.

As a matter of fact, I ran the app through strace, and found that libcuda.so.1 is searched in many, many directories, before finally settling for /usr/lib/wsl/lib/libcuda.so.1 . HOWEVER, the same cannot be said of libnvoptix.so.1, or the loader - the logs tell me the loader is never searched upon, and looking for libnvoptix.so.1 is tried through the same directories as libcuda.so.1 except for the /usr/lib/wsl/lib directory. It is as if the OptiX API was intentionally skipping that particular directory.

Am I missing something here? Should I be somehow telling OptiX to do a search at the full library path to find libnvoptix.so.1? Or is there something I misconfigured in my app?

(And, no, I haven’t attempted yet to create a symlink to the library - I don’t get why libcuda.so.1 is found, but libnvoptix.so.1 isn’t…)

Any help you could provide will be highly appreciated!

Hi @heriberto.delgado,

OptiX is not currently expected to run via WSL, the WSL driver does not yet contain everything necessary. We are actively working on a mechanism for enabling OptiX in the WSL driver, but unfortunately it’s probably not going to happen very quickly. Sorry for the inconvenience (we want to use OptiX in WSL internally as well.) In the mean time, the way to use OptiX on Windows is to build a native Windows app and use the native (non-WSL) Windows driver.


David.