Ollama Cannot Detect Your GPU on Windows: A Windows-Specific Guide
Scope: A Windows machine where Ollama is installed,
ollama runproduces results but is abnormally slow,ollama psshows 100% CPU, and server logs mention GPU discovery failures or initialization error codes. This article covers only Windows-specific steps - native install versus WSL2 boundaries, driver thresholds, log locations and debug logging, discovery error codes, and environment-variable overrides. A detected GPU that merely offloads too few layers is a different topic, covered by the RTX 4060 layer troubleshooting guide on this site; that separation is exactly what distinguishes the two articles.
Short answer: a Windows "GPU not detected" case is rarely a broken card. It is usually a driver below the required threshold, a WSL2 or container path where the device was never passed through, or an environment variable masking the GPU. The Ollama Windows page, hardware support page, and troubleshooting page are the sources every command, path, and number here was checked against. This article deliberately skips the cross-platform five-step checklist and goes deep only on Windows-specific traps. Wherever paths, error text, or defaults are involved, it says "verify against your environment", because those change with version and install method.
1. First, determine which kind of Windows install you are running
This is the first Windows-specific fork and the root of many wrong turns. The official Windows page says Ollama runs as a native Windows application: after installation it runs in the background, the ollama command is available in cmd, PowerShell, or your favorite terminal, and the API is served on http://localhost:11434. On this path GPU support comes from the native Windows NVIDIA or AMD Radeon driver, and you read the Windows host's own logs.
The other path is WSL2 or a Docker container. The official troubleshooting page states, in its NVIDIA GPU Discovery section, that if you run Ollama in a container you must first set up the container runtime as described in the Docker docs, and gives the verification command docker run --gpus all ubuntu nvidia-smi: if this does not work, Ollama cannot see your NVIDIA GPU. In other words, on the WSL2/container path "no GPU detected" is usually a passthrough problem rather than an Ollama problem. Answer "am I running in the native app or inside WSL2/container?" before choosing checks below; the logs, driver expectations, and environment-variable scope differ between the two, and mixing them wastes time.
2. Native install: check the driver threshold first
The native Windows requirements are explicit on the official Windows page: Windows 10 22H2 or newer, Home or Pro, and NVIDIA 551.61 or newer drivers. The hardware support page adds a cross-platform threshold: NVIDIA compute capability 5.0+ with driver 550 and newer, while capability 5.0 through 6.2 requires driver 570 or newer. An RTX 4060 has compute capability 8.9 and appears under GeForce RTX 40xx, so it falls under the looser general driver rule, but a native Windows install is still governed by the stricter 551.61 line. Read both: first compute capability to decide whether the card is supported at all, then driver version for your install path.
Native Windows: Windows 10 22H2+; NVIDIA driver 551.61+
General hardware: capability 5.0+ and driver 550+; 5.0-6.2 cards need 570+
Below these versions Ollama may fall back to CPU without a prominent error. After upgrading the driver, reboot and verify again - do not upgrade without restarting, because driver module state is only clean after a reboot. Thresholds can change with releases, so verify against the notes bundled with your installed version.
3. Turn on debug logging and look in the right place
Without logs, "not detected" is only a guess. The official troubleshooting page gives these Windows locations:
%LOCALAPPDATA%\Ollama logs and downloaded updates
server.log most recent server logs
server-#.log older server logs
app.log recent logs from the GUI application
upgrade.log log output for upgrades
%HOMEPATH%\.ollama models and configuration
%TEMP% temporary executables in one or more ollama* directories
Press Win+R and enter explorer %LOCALAPPDATA%\Ollama to open the log directory; every path above comes from the official troubleshooting and Windows pages. For more detailed logging, the official procedure is to quit the app from the tray menu first, then run the following in PowerShell:
Note this sets the variable for the current PowerShell session only - closing the window loses it. For a persistent setting, add OLLAMA_DEBUG in the system environment-variable settings instead. After enabling it, trigger a load again and read the GPU discovery details in server.log. The docs also mention a line resembling Dynamic LLM libraries [...] in the server log, with contents varying by release; if autodetection fails, OLLAMA_LLM_LIBRARY can force a specific library, with the official example OLLAMA_LLM_LIBRARY="cpu_avx2" ollama serve - that forces the CPU library, the opposite of the goal, and is listed only to show that library selection is a dimension worth checking. Log names and wording change with the version, so verify against your environment.
4. Recognize the signals of a failed discovery
The most valuable thing to find in the server log is an error code. The official troubleshooting page lists, in its NVIDIA GPU Discovery section, that GPU initialization or discovery failures can show up as 3 (not initialized), 46 (device unavailable), 100 (no device), and 999 (unknown). These come from the driver layer, not the model-loading layer, so when you see them the direction is: is the driver current, is the uvm module loaded, is the container runtime working. For more diagnostic output the docs suggest setting CUDA_ERROR_LEVEL=50 and retrying, plus checking kernel logs with sudo dmesg | grep -i nvrm and sudo dmesg | grep -i nvidia. Note those two dmesg commands are from the Linux NVIDIA Troubleshooting section: Windows has no dmesg, so treat that subsection as a guide to what the codes mean, not as commands to paste into a Windows terminal - on Windows rely on the detailed server.log output.
The other signal is "has a card but does not use it". The official hardware page says that to ignore GPUs and force CPU usage you set CUDA_VISIBLE_DEVICES to an invalid GPU ID such as -1. So when a machine clearly has a card yet keeps running on CPU, the first check is whether some script set this variable to -1 - more common than you would expect, for example a "power saving" profile or another tool's launcher. On multi-GPU hosts, restrict Ollama to a subset with a comma-separated list; the docs note numeric ID order can vary and that UUIDs from nvidia-smi -L are more reliable. Discovery itself takes time, and the discovery records in the log are direct evidence of whether the card was ever seen.
5. Windows-specific traps and cross-checks
Native versus WSL2 boundary. The official Windows page describes the native install as a background app plus CLI, with Windows 10 22H2+ and 551.61+ drivers sufficient, while container and WSL2 paths require verifying passthrough with docker run --gpus all ubuntu nvidia-smi. If you see "nvidia-smi works inside WSL2 but Ollama still runs on CPU", verify at both layers: run nvidia-smi on the Windows host and inside the WSL2 distro, and count it as successful only if both show the card. Then confirm which layer the Ollama process runs in - a native Windows process will not use environment variables configured inside WSL2, and vice versa. This is unique to dual Windows environments and never arises on a single-system machine.
Terminal and control characters. An easily overlooked Windows entry in the troubleshooting page: older Windows 10 versions such as 21H1 have a bug where the standard terminal does not display control characters correctly, producing a long string like ←[?25h←[?25l and sometimes The parameter is incorrect. The official fix is to update to Windows 10 22H1 or newer - close to the 22H2 system requirement. When you see display artifacts like this, check the OS version first instead of blaming Ollama.
The three-way cross-check. Use ollama ps to read the PROCESSOR column (100% GPU, 100% CPU, or a mixed ratio), nvidia-smi to see whether an Ollama process and VRAM usage are present, and server.log for the discovery record and error codes. Only change configuration when all three point to the same conclusion. The interpretation of these three is covered by the Ollama Deployment Handbook on this site; whether VRAM is sufficient is covered by 8 GB VRAM OOM troubleshooting. This article only answers the narrower question of whether Windows discovered the GPU at all.
6. Acceptance checklist before calling it done
- Identified whether Ollama runs natively on Windows or inside WSL2/container, with checks matched to that path
- OS is Windows 10 22H2+ and the NVIDIA driver meets 551.61+ and the compute-capability threshold
- Rebooted after upgrading the driver and verified again, not just upgraded
- Quit the app from the tray before starting a debug session with OLLAMA_DEBUG=1, and read server.log
- Recorded discovery entries and error codes; did not paste Linux-only commands into Windows
- Checked that CUDA_VISIBLE_DEVICES is not -1 or another unexpected value
- On WSL2/container, verified passthrough with
docker run --gpus all ubuntu nvidia-smiand saw the card on both host and distro sides - The three-way cross-check (ollama ps / nvidia-smi / server.log) agrees, with versions and on-site output recorded
One last principle: for "GPU not detected" on Windows, find out which layer cannot see the card - driver, passthrough, or environment variable. Once the layer is clear, the commands almost suggest themselves; reinstalling Ollama at the first sign of trouble is mostly luck. For the related trade-offs of quantization and memory, see LLM Quantization in Practice on this site - a different layer of the problem, not to be confused with discovery failures.