Local LLM troubleshooting on Linux
GPU gone after a kernel update, NVML version mismatch, Secure Boot rejecting the driver, systemd ignoring your environment: the Linux fixes, with commands.
ollama psOn Linux the GPU either works or it is completely absent, and the absence is nearly always the kernel module rather than the card. The driver package on disk and the module in the running kernel are two different things, and anything that changes one without the other — an apt upgrade that installed a new kernel, a driver bumped while the old module was still loaded, Secure Boot refusing to load something unsigned — produces the same terse message about failing to communicate with the NVIDIA driver.
The second family of Linux problems is not the hardware at all: it is which user, and which environment, your inference is running as. The Ollama installer sets up a systemd service running as its own user, so the variables you exported in your shell configure your shell and nothing else. AMD's compute device nodes belong to the render and video groups, so ROCm works under sudo and fails as you. Containers see the GPU only if the NVIDIA Container Toolkit has been wired into the Docker runtime.
Every fix below states the Ubuntu/Debian command, and the Fedora or Arch equivalent where it genuinely differs. Start with nvidia-smi or rocminfo: if the card is not there, you are in the first group; if it is there and something still will not use it, you are in the second.
- CUDA out of memorytorch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 2.00 GiB (GPU 0; 8.00 GiB total capacity; 7.21 GiB already allocated)
- Ollama: "model requires more system memory than is available"Error: model requires more system memory (9.2 GiB) than is available (7.6 GiB)
- LM Studio: "Failed to load model" (insufficient memory)Failed to load model. Error loading model: unable to allocate backend buffer
- "No CUDA-capable device is detected"RuntimeError: No CUDA-capable device is detected
- Out of memory at long context (the KV cache, not the weights)llama_new_context_with_model: failed to allocate KV cache
- AMD GPU not detected / ROCm unsupported (Ollama & llama.cpp)Error: no compatible GPUs were discovered
- Out of disk space / failed GGUF download for large modelsError: write /root/.ollama/models/blobs/sha256-...: no space left on device
- Ollama "connection refused"curl: (7) Failed to connect to localhost port 11434: Connection refused
- Ollama /v1/systemone errors: 400, 404, 413 explained{"error": "request body must not exceed 64 KiB without images"}
- Ollama /v1/systemone image errors: 400, 413, HEIC and sideways photosHTTP 400 or 413 from POST /v1/systemone as soon as the request has an "images" array, or a 200 whose answers ignore the picture
- CUDA works on Windows but not inside WSL2NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
- nvidia-smi stopped working after a kernel updateNVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
- "Failed to initialize NVML: Driver/library version mismatch"Failed to initialize NVML: Driver/library version mismatch
- Secure Boot is blocking your GPU driver modulemodprobe: ERROR: could not insert 'nvidia': Key was rejected by service
- Your Docker container can't see the GPUdocker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
- ROCm doesn't support your AMD cardError: no compatible GPUs were discovered
- "Permission denied" on /dev/kfdUnable to open /dev/kfd read-write: Permission denied
- Ollama on a headless Linux serverError: write /usr/share/ollama/.ollama/models/blobs/sha256-...: no space left on device
- Which GGUF quant should I download? (Q4 vs Q5 vs Q8)Which GGUF quant should I download?
- Local LLM repeating itself or stuck in a loopThe same sentence again. The same sentence again. The same sentence again. The same sentence ag
- Local LLM outputs gibberish? Wrong chat template<|im_start|>assistant<|im_end|> <|im_start|>user I I I the the of of<|endoftext|>assistantassistant