Optix on WSL (Windows Subsystem for Linux)

With the experimental support for CUDA on WSL out I was wondering if Optix is also able to run on WSL. I tried a sample project earlier but was not able to get it to run. Although I am still not sure if I did it right ;)

So should I even bother trying to get it to run or is Optix not yet supported?

I haven’t heard of anyone on the team even trying OptiX on WSL yet, but we’d certainly like to support it officially as soon as CUDA on WSL is official.

What is the issue you ran into? Maybe the fix is easy… fingers crossed. Were you able to build the OptiX sample in WSL? Are you able to build and run any of the CUDA SDK samples?


I just tried again. I also reinstalled CUDA because I couldn’t find its samples directory earlier. I am now on CUDA 11. Compiling and running the CUDA sample “BlackScholes” did work, it did recognize my GPU (showed “GPU Device 0: “Pascal” with compute ability 6.1”).

Now to OptiX: I tried the OptiX 7 SDK and after changing “sm_30” in the CMakeLists.txt file to “sm_35” it did compile (Probably because of CUDA 11?). But running “./optixHello” gave me
Caught exception: OPTIX_ERROR_LIBRARY_NOT_FOUND: Optix call 'optixInit()' failed: /opt/optix7/NVIDIA-OptiX-SDK-7.0.0-linux64/SDK/optixHello/optixHello.cpp:125)

But I have not configured my system for X11 forwarding to Windows so maybe it just couldn’t display the window? Although the above was the only error message and it seems to be an OptiX problem.

Anyways, thanks for the quick reply!

Edit: ./optixHello -f test gave me the same error message. So probably not a “opening a window” problem…

Edit2: Retried OptiX SDK optixHello with CUDA 10.2, still the same error.


Yes some of the Optix libraries that are usually part of the native linux driver package and and needed for Optix 7.0 are not yet there for WSL (older versions of Optix might work without it). So these apps won’t run until they get added.

Thanks and sorry you ran into this, we will post an update when we will have more to share about this.

No problem! I continued to investigate and installed some libraries from your repos:


But this time I got this error:

$ ./optixHello
[ 2][       ERROR]: Specified 0 as the CUDA context, but the current CUDA context could not be queried. (CUDA error string: initialization error, CUDA error code: 3)
Caught exception: OPTIX_ERROR_CUDA_NOT_INITIALIZED: Optix call 'optixDeviceContextCreate( cuCtx, &options, &context )' failed: /opt/optix7/NVIDIA-OptiX-SDK-7.0.0-linux64/SDK/optixHello/optixHello.cpp:129)

So as you said, rboissel, it seems some libraries are still missing. Thanks for the heads-up!

Yes you are running optix7. and this requires extra driver components that we haven’t yet added to the WSL driver package.
We will post an update when this gets added to WSL.