Enable CUDA for WSL
Our guides
Get started
Enabling CUDA on WSL2 is currently the only option to share GPU power on WSL2 at the moment of writing, there is no AMD OpenCL support yet.
1. Determine your windows 10 version
Press the start button and type “winver” a popup screen appears, look for (OS Build xxxxx.xxxx)
check the first 5 digits, these need to be equal or higher than 20150
If your build number is lower than this, continue with step 2 otherwise continue with step 3
2. Updating windows version to latest development version
The first thing you need to do is register for the Windows insider Program when you have completed the registration follow the instruction to install the latest insider build.
3. Install the Nvidia CUDA driver
Download and install the Nvidia CUDA enabled driver for WSL2
4. Check WSL kernel version
Version 4.19.121 or higher is required for CUDA to work, in order to check the current version, start PowerShell and execute
wsl cat /proc/version
If your version is lower than run windows update.