Get Ollama back on the NVIDIA GPU after suspend and resume
ollama/ollama docs/gpu.mdx (main) has a 'Linux Suspend Resume' section calling this an NVIDIA driver bug where Ollama sometimes fails to discover the GPU after resume and falls back to CPU, with the workaround sudo rmmod nvidia_uvm && sudo modprobe nvidia_uvm. On this Omarchy 4.0.4-1 NVIDIA machine, /etc/mkinitcpio.conf.d/nvidia.conf is MODULES+=(nvidia nvidia_modeset nvidia_uvm nvidia_drm), written by /usr/share/omarchy/install/hardware/nvidia.sh, and lsmod shows nvidia_uvm with a use count of 0 while the graphical session runs, so it can be unloaded once Ollama is stopped. /dev/nvidia-uvm exists for the fuser check. The rmmod/modprobe was not run here.
Symptom
Ollama used the NVIDIA GPU fine until the machine slept. After resume, models load on the CPU (ollama ps shows 100% CPU), generation is slow, and the service log no longer lists the CUDA device. Rebooting fixes it until the next suspend.
Cause
Ollama's own GPU documentation describes this as an NVIDIA driver bug: after a suspend and resume cycle Ollama sometimes fails to discover the NVIDIA GPU and falls back to the CPU. The workaround it documents is reloading the NVIDIA Unified Memory module nvidia_uvm, which CUDA uses. On Omarchy 4, nvidia_uvm is loaded early from the initramfs (/etc/mkinitcpio.conf.d/nvidia.conf), but it can still be unloaded and reloaded at runtime once nothing holds it.
Fix
Stop anything using CUDA, reload the module, restart Ollama:
sudo systemctl stop ollama
sudo rmmod nvidia_uvm
sudo modprobe nvidia_uvm
sudo systemctl start ollama
If rmmod reports Module nvidia_uvm is in use, find the holder and stop it first:
sudo fuser -v /dev/nvidia-uvm
This is the same on Omarchy 4 and plain Arch.
Verify
ollama run <model> 'hi' followed by ollama ps shows 100% GPU, and nvidia-smi lists the ollama process.