Hey chat, how to configure WSL on Windows 10 to make use of the Nvidia ram?
- User
Hey chat, how to configure WSL on Windows 10 to make use of the Nvidia ram?
- Assistant
Hey chat, how to configure WSL on Windows 10 to make use of the Nvidia ram?
To configure Windows Subsystem for Linux (WSL) on Windows 10 to make use of your NVIDIA GPU's memory (VRAM), you'll need to enable GPU acceleration within WSL2. This allows you to run GPU-accelerated applications, such as those using CUDA for computation, directly within your Linux environment on Windows.
Here's a step-by-step guide to help you set this up:
Windows 10 Version
Win + R, type winver, and press Enter.NVIDIA GPU
Administrative Privileges
Enable WSL and Virtual Machine Platform
Open PowerShell as an administrator.
Run the following commands:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Set WSL2 as the Default Version
Run:
wsl --set-default-version 2
Install a Linux Distribution
Download the NVIDIA CUDA Driver for WSL
Install the Driver
Open Your Linux Distribution
Update Package Lists
sudo apt update
Install Required Dependencies
sudo apt install -y build-essential
Add NVIDIA Package Repositories
Ubuntu 20.04 Example:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-get update
Install CUDA Toolkit
sudo apt-get install -y cuda
Check NVIDIA System Management Interface
nvidia-smi
Compile and Run CUDA Samples
cd /usr/local/cuda/samples/1_Utilities/deviceQuery
sudo make
./deviceQuery
Edit Your .bashrc File
nano ~/.bashrc
Add the Following Lines at the End
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
Save and Exit
Ctrl + O, then Enter to save.Ctrl + X to exit.Reload .bashrc
source ~/.bashrc
Download cuDNN
Install cuDNN
Copy the downloaded file to your WSL2 home directory.
Extract and move the files to the CUDA directories:
tar -xzvf cudnn-linux-x86_64-*.tgz
sudo cp cuda/include/cudnn*.h /usr/local/cuda/include
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64/
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*
If nvidia-smi Fails:
Ensure that the NVIDIA driver is correctly installed on Windows.
Check that you're running WSL2, not WSL1:
wsl --list --verbose
If your distribution is version 1, convert it:
wsl --set-version <distribution name> 2
CUDA Version Mismatch:
Access Permissions:
sudo.GPU Compute Only:
Supported Distributions:
Performance Considerations:
By following these steps, you should be able to configure WSL on Windows 10 to make use of your NVIDIA GPU's VRAM, enabling GPU-accelerated applications within your Linux environment.
Not yet included in a published release.