This guide shows step-by-step instructions to setup vLLM on WSL Ubuntu 22.04 with NVIDIA GPU support.
wsl --list --verboseMake sure the version is 2. If not, update WSL following Microsoft WSL installation guide.
wsl --list --verbose
Install default Ubuntu:
wsl --install
Or install a specific version:
wsl --list --online
wsl --install -d Ubuntu-22.04
If you have a previous Ubuntu installation that you no longer need:
wsl --unregister <distro_name>
open any terminal, enters WSL
wsl
# or specify version
# wsl -d Ubuntu-22.04
sudo apt update
sudo apt install nvidia-driver nvidia-utils
sudo reboot
nvidia-smi
You should see someting like below
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.163.01 Driver Version: 560.94 CUDA Version: 12.6 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 3070 On | 00000000:01:00.0 On | N/A |
| 0% 39C P8 22W / 220W | 796MiB / 8192MiB | 3% Default |
| | | N/A |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda-toolkit-13-0
References:
Add CUDA binaries and libraries to environment variables:
echo 'export PATH=${PATH}:/usr/local/cuda-13.0/bin' >> ~/.bashrc
source ~/.bashrc
nvcc --version
Expected output:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2025 NVIDIA Corporation
Built on Wed_Aug_20_01:58:59_PM_PDT_2025
Cuda compilation tools, release 13.0, V13.0.88
Build cuda_13.0.r13.0/compiler.36424714_0
curl -LsSf https://astral.sh/uv/install.sh | sh
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
uv --version
uv venv --python 3.12
source .venv/bin/activate
uv pip install --upgrade pip
uv pip install vllm
-
Always source ~/.bashrc after changing environment variables.
-
If you upgrade CUDA or Python, recreate your venv to avoid conflicts.
-
For GPU troubleshooting, use nvidia-smi and check CUDA installation with nvcc --version.