Setting up my dev environment
By Almira
At the start of every year, I like to wipe my PC clean and start over: reinstall everything, delete the junk I never touch, and rebuild my dev environment from scratch. My basic setup is always the same combination: CUDA, WSL, Docker, Git and VSCode. This year I actually wrote the steps down instead of relying on memory and old screenshots I can never find again, so here's the full walkthrough of how I set up a GPU-ready dev environment on Windows.
1. Installing CUDA#
First up, CUDA. Grab the latest version from the official NVIDIA website. Before you download anything though, check what GPU you actually have: open Task Manager and go to the 'Performance' tab. Your GPU details show up in the upper right corner, like this:
Task Manager Performance tab showing GPU information
Download the driver and install it. Once that's done, verify it worked by opening PowerShell and running:
nvidia-smiYou should see your GPU details along with the CUDA version it supports.
nvidia-smi command output showing GPU information
2. Installing WSL#
Docker Desktop needs WSL2 to run, so that's next. Make sure virtualization is enabled first (you can check this in Task Manager), then install WSL with:
wsl --installIf you don't have a distro installed yet, grab one with the command below. Ubuntu is just the distribution name here:
wsl --install -d Ubuntu3. Installing Docker#
Now for Docker itself. Download the latest version from the official Docker website, install it, then open Docker Desktop and check two things: "Use the WSL 2 based engine" needs to be checked (see left image below), and the default distro needs to be toggled on (see right image below).
Docker Desktop WSL2 configuration settings
Next, check that Docker can actually see your GPU. Spin up a container and run the nvidia-smi command inside it. One catch: the NVIDIA CUDA image you pick has to match your CUDA version. My machine is on CUDA 13.0, so I can only use NVIDIA CUDA images at or below that version, in my case 12.6.0:
docker run --rm --gpus all nvidia/cuda:12.6.0-base-ubuntu22.04 nvidia-smi4. Installing Git#
Git's next. Download it from the official Git website and install it as usual. Then open PowerShell and generate an SSH key:
ssh-keygen -t ed25519 -C "your_email@example.com"Copy your public key so you can paste it wherever you store your code, GitHub, Bitbucket, whatever:
Get-Content .\.ssh\id_ed25519.pub | clipPaste that key into your repo's SSH settings. Here's what that looks like on GitHub:
GitHub SSH key configuration page
5. Installing VSCode#
Last one: install VSCode as usual and start a container. To get your host machine's SSH key shared into that container, the OpenSSH Authentication Agent needs to be running and enabled. Go to 'Services', find it, and turn it on. You might have to restart your container for it to actually take effect. Once that's done, you can push and pull from your Git repo inside the container without ever registering a separate SSH key for it.
Windows Services showing OpenSSH Authentication Agent
Aaaannnddd...that's it! Happy coding!