I’m interested in working with CUDA on WSL2, but don’t have a spare machine (or courage) to use Windows beta or dev releases. Reading about the pre-release version available, I’ve upgraded to the latest pre-release version of 21H2 (19044), which I read should support GPU usage in VMs, including WSL2.
However, even after doing this, upgrading to the latest linux kernel, and installing the proper nvidia packages in ubuntu, I’m still not seeing /dev/dxg and the libraries from lxss aren’t appearing in the ubuntu tree.
I’m guessing the (disappointing) issue is that the 19044 build of 21H2 doesn’t have the right juju built in to make this work. Can anyone confirm? Has anyone succeeded?
You may find below section more useful. At present WSL2. is available only to Windows Insider Program users. The minimum OS build is 20145, although we recommend the latest WIP OS available for better performance and latest features.
Ensure you are registered on Windows Insider Program and subscribing to the Dev Channel and OS build is 20145 or later. We recommend at least OS 21390 or higher for latest features and performance updates.
Ensure the WSL Kernel installed is the latest version or at least 4.19.121+. Once again, we recommend 5.10.16.3 or later for better performance.
WSL2 GPU acceleration will be available on Pascal and later GPU architecture on both GeForce and Quadro product SKUs in WDDM mode. It will not be available on Quadro GPUs in TCC mode or Tesla GPUs yet.
FYI – as OP here. I did get the 19044.1200 build, and was able to build/run BlackSholes and a bunch of other things successfully! (thanks to whoever pinged the thread when the release was made).
Now I’m trying to figure out the right way to build something that wants “GL/gl.h”, but not stuck yet…
$ sudo sh cuda_11.4.1_470.57.02_linux.run
===========
= Summary =
===========
Driver: Not Selected
Toolkit: Installed in /usr/local/cuda-11.4/
Samples: Installed in /home/myhome/, but missing recommended libraries
Please make sure that
- PATH includes /usr/local/cuda-11.4/bin
- LD_LIBRARY_PATH includes /usr/local/cuda-11.4/lib64, or, add /usr/local/cuda-11.4/lib64 to /etc/ld.so.conf and run ldconfig as root
To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-11.4/bin
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 470.00 is required for CUDA 11.4 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
sudo <CudaInstaller>.run --silent --driver
Logfile is /var/log/cuda-installer.log
Running deviceQuery also confirmed it was reading correctly my GPU.
yet same as @stevek I can’t build really other samples.
/usr/local/cuda-11.4/samples/5_Simulations/smokeParticles$ make
dpkg-query: no packages found matching nvidia-*
>>> WARNING - libGL.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
>>> WARNING - libGLU.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
>>> WARNING - gl.h not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
>>> WARNING - glu.h not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
>>> GCC Version is greater or equal to 5.0.0 <<<
If you wish to build all the samples, including those with graphical rather than
command-line interfaces, additional system libraries or headers may be required.
While every Linux distribution is slightly different with respect to package names and
package installation procedures, the libraries and headers most likely to be necessary are
OpenGL (e.g., Mesa), GLU, GLUT, and X11 (including Xi, Xmu, and GLX).
On Ubuntu, those can be installed as follows: