WSL – explained simply
WSL lets you run a Linux environment directly under Windows, without a second operating system or a classic virtual machine.
Also: Windows Subsystem for Linux, WSL2, WSL 2
Some AI projects are developed first, or only, for Linux. With WSL, you can still use them on your Windows PC. WSL 2 is the default version and runs a real Linux kernel in a lightweight virtual environment.
According to Microsoft, WSL can use the graphics card to speed up machine learning computations under Linux. However, familiar beginner tools like ComfyUI or Ollama also run directly on Windows, so you don't need WSL for them.
What does that mean for you? Only use WSL when a tool explicitly requires Linux; for most beginner tools, it's unnecessary.
Related terms
Errors where that matters
- could not select device driver "" with capabilities: [[gpu]] (Docker cannot pass the graphics card through to the container)
- Docker Desktop: WSL needs updating / WSL 2 installation is incomplete
- hipErrorNoBinaryForGpu: Unable to find code object for all current devices! (ROCm has no matching code for your AMD card)
- nvidia-smi: command not found in WSL (CUDA not available in WSL — the only correct driver is the Windows driver)
- Ollama: could not connect to ollama app, is it running? (Ollama server is not running or can’t be reached)
- Ollama: max retries exceeded during download (ollama pull aborts)
- pip: error: externally-managed-environment (Linux/WSL)
- Ports are not available: … bind: An attempt was made to access a socket in a way forbidden by its access permissions (Port is reserved by Windows)
- Transformers: FlashAttention2 has been toggled on, but … flash_attn seems to be not installed (FlashAttention missing)
- WSL 2: 0x80370102 – Virtualization not enabled