Back to Cookbook
IntermediateEdge / Local 10 min read

WSL2 + Ollama GPU Passthrough on Windows

Run Ollama with NVIDIA GPU acceleration inside WSL2 — the most reliable Windows path for local LLMs.

WSL2WindowsOllamaNVIDIACUDA

Prerequisites

You need Windows 11 (or Win10 21H2+), an NVIDIA GPU, and the latest Windows NVIDIA driver. WSL2 CUDA does not need a separate Linux driver install.

powershell
# In PowerShell (Admin)
wsl --install
wsl --update

# Verify GPU visible inside WSL
wsl nvidia-smi

Install Ollama in WSL

Install inside Ubuntu WSL, not Windows native, for best GPU compatibility. Access the API from Windows at localhost:11434.

bash
curl -fsSL https://ollama.com/install.sh | sh
ollama pull qwen2.5:7b
ollama run qwen2.5:7b

# From Windows browser or PowerShell:
# curl http://localhost:11434/api/tags
Deployment guides are educational. Each model is subject to its own license — read the official Hugging Face model card before downloading or deploying.