Skip to content

Instantly share code, notes, and snippets.

@poivronvert
Created September 26, 2025 11:39
Show Gist options
  • Select an option

  • Save poivronvert/5e5e3eff2dcdbeddc508adf0c8a09743 to your computer and use it in GitHub Desktop.

Select an option

Save poivronvert/5e5e3eff2dcdbeddc508adf0c8a09743 to your computer and use it in GitHub Desktop.
How to setup vLLM on WSL Ubuntu 22.04

Setup vLLM on WSL Ubuntu 22.04

This guide shows step-by-step instructions to setup vLLM on WSL Ubuntu 22.04 with NVIDIA GPU support.


1. Prerequisites

1.1 Check installed WSL version

wsl --list --verbose

Make sure the version is 2. If not, update WSL following Microsoft WSL installation guide.

1.2 Install Ubuntu 22.04

wsl --list --verbose

Install Linux version

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>

2. Enter WSL

open any terminal, enters WSL

wsl 
# or specify version
# wsl -d Ubuntu-22.04

3. Install NVIDIA driver

sudo apt update
sudo apt install nvidia-driver nvidia-utils
sudo reboot

4. Verify NVIDIA driver

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 |

5. Install CUDA Toolkit

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:

6. Configure CUDA environment

Add CUDA binaries and libraries to environment variables:

echo 'export PATH=${PATH}:/usr/local/cuda-13.0/bin' >> ~/.bashrc
source ~/.bashrc

7. Verify CUDA installation

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

8. Install UV

curl -LsSf https://astral.sh/uv/install.sh | sh

9. Configure UV path

echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

10. Verify UV installation

uv --version

11. Create Python virtual environment and install vLLM

uv venv --python 3.12
source .venv/bin/activate
uv pip install --upgrade pip
uv pip install vllm    

Notes

  1. Always source ~/.bashrc after changing environment variables.

  2. If you upgrade CUDA or Python, recreate your venv to avoid conflicts.

  3. For GPU troubleshooting, use nvidia-smi and check CUDA installation with nvcc --version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment