[GH-ISSUE #10204] Ollama ignores CUDA after reboot, falls back to CPU only #53205

Closed
opened 2026-04-29 02:23:11 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @Johnreidsilver on GitHub (Apr 9, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10204

What is the issue?

After installing Ollama it runs on GPU, but after reboot it ignores the CUDA GPU and falls back to CPU only.
Ubuntu 24.04.2 LTS
Kernel 6.11.0-21-generic #21~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC
NVIDIA-SMI 570.86.15 Driver Version: 570.86.15 CUDA Version: 12.8
RTX 3060 laptop (+ AMD 5800H iGPU, no ROCm installed)

rerunning the install script recognizes the GPU, but won't persist on reboot.

Relevant log output

-- Boot 9868c331ff3d457f953b38810495ab74 --
Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H systemd[1]: Started ollama.service - Ollama Service.
Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: 2025/04/09 19:36:55 routes.go:1231: INFO server config env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_CONTEXT_LENGTH:2048 OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/usr/share/ollama/.ollama/models OLLAMA_MULTIUSER_CACHE:false OLLAMA_NEW_ENGINE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* vscode-file://*] OLLAMA_SCHED_SPREAD:false ROCR_VISIBLE_DEVICES: http_proxy: https_proxy: no_proxy:]"
Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.550+01:00 level=INFO source=images.go:458 msg="total blobs: 66"
Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.552+01:00 level=INFO source=images.go:465 msg="total unused blobs removed: 0"
Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.553+01:00 level=INFO source=routes.go:1298 msg="Listening on 127.0.0.1:11434 (version 0.6.5)"
Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.554+01:00 level=INFO source=gpu.go:217 msg="looking for compatible GPUs"
Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.572+01:00 level=INFO source=gpu.go:602 msg="no nvidia devices detected by library /usr/lib/x86_64-linux-gnu/libcuda.so.570.86.15"
Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.588+01:00 level=WARN source=amd_linux.go:61 msg="ollama recommends running the https://www.amd.com/en/support/linux-drivers" error="amdgpu version file missing: /sys/module/amdgpu/version stat /sys/module/amdgpu/version: no such file or directory"
Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.589+01:00 level=WARN source=amd_linux.go:443 msg="amdgpu detected, but no compatible rocm library found.  Either install rocm v6, or follow manual install instructions at https://github.com/ollama/ollama/blob/main/docs/linux.md#manual-install"
Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.589+01:00 level=WARN source=amd_linux.go:348 msg="unable to verify rocm library: no suitable rocm found, falling back to CPU"
Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.589+01:00 level=INFO source=gpu.go:377 msg="no compatible GPUs were discovered"
Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.589+01:00 level=INFO source=types.go:130 msg="inference compute" id=0 library=cpu variant="" compute="" driver=0.0 name="" total="27.3 GiB" available="26.1 GiB"

cat /etc/systemd/system/ollama.service

[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/local/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin"

[Install]
WantedBy=default.target

reinstalling:
curl -fsSL https://ollama.com/install.sh | sh

>>> Cleaning up old version at /usr/local/lib/ollama
>>> Installing ollama to /usr/local
>>> Downloading Linux amd64 bundle
######################################################################## 100.0%
>>> Adding ollama user to render group...
>>> Adding ollama user to video group...
>>> Adding current user to ollama group...
>>> Creating ollama systemd service...
>>> Enabling and starting ollama service...
>>> NVIDIA GPU installed.

ollama run deepcoder
ollama ps

NAME                ID              SIZE     PROCESSOR          UNTIL              
deepcoder:latest    12bdda054d23    10 GB    47%/53% CPU/GPU    4 minutes from now 

OS

Linux

GPU

Nvidia

CPU

AMD

Ollama version

0.6.5

Originally created by @Johnreidsilver on GitHub (Apr 9, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10204 ### What is the issue? After installing Ollama it runs on GPU, but after reboot it ignores the CUDA GPU and falls back to CPU only. Ubuntu 24.04.2 LTS Kernel 6.11.0-21-generic #21~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC NVIDIA-SMI 570.86.15 Driver Version: 570.86.15 CUDA Version: 12.8 RTX 3060 laptop (+ AMD 5800H iGPU, no ROCm installed) rerunning the install script recognizes the GPU, but won't persist on reboot. ### Relevant log output ```shell -- Boot 9868c331ff3d457f953b38810495ab74 -- Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H systemd[1]: Started ollama.service - Ollama Service. Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: 2025/04/09 19:36:55 routes.go:1231: INFO server config env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_CONTEXT_LENGTH:2048 OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://127.0.0.1:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/usr/share/ollama/.ollama/models OLLAMA_MULTIUSER_CACHE:false OLLAMA_NEW_ENGINE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* vscode-file://*] OLLAMA_SCHED_SPREAD:false ROCR_VISIBLE_DEVICES: http_proxy: https_proxy: no_proxy:]" Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.550+01:00 level=INFO source=images.go:458 msg="total blobs: 66" Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.552+01:00 level=INFO source=images.go:465 msg="total unused blobs removed: 0" Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.553+01:00 level=INFO source=routes.go:1298 msg="Listening on 127.0.0.1:11434 (version 0.6.5)" Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.554+01:00 level=INFO source=gpu.go:217 msg="looking for compatible GPUs" Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.572+01:00 level=INFO source=gpu.go:602 msg="no nvidia devices detected by library /usr/lib/x86_64-linux-gnu/libcuda.so.570.86.15" Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.588+01:00 level=WARN source=amd_linux.go:61 msg="ollama recommends running the https://www.amd.com/en/support/linux-drivers" error="amdgpu version file missing: /sys/module/amdgpu/version stat /sys/module/amdgpu/version: no such file or directory" Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.589+01:00 level=WARN source=amd_linux.go:443 msg="amdgpu detected, but no compatible rocm library found. Either install rocm v6, or follow manual install instructions at https://github.com/ollama/ollama/blob/main/docs/linux.md#manual-install" Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.589+01:00 level=WARN source=amd_linux.go:348 msg="unable to verify rocm library: no suitable rocm found, falling back to CPU" Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.589+01:00 level=INFO source=gpu.go:377 msg="no compatible GPUs were discovered" Apr 09 19:36:55 laptopLenovo-Legion-5-Pro-16ACH06H ollama[1555]: time=2025-04-09T19:36:55.589+01:00 level=INFO source=types.go:130 msg="inference compute" id=0 library=cpu variant="" compute="" driver=0.0 name="" total="27.3 GiB" available="26.1 GiB" ``` cat /etc/systemd/system/ollama.service ```shell [Unit] Description=Ollama Service After=network-online.target [Service] ExecStart=/usr/local/bin/ollama serve User=ollama Group=ollama Restart=always RestartSec=3 Environment="PATH=/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin" [Install] WantedBy=default.target ``` reinstalling: curl -fsSL https://ollama.com/install.sh | sh ```shell >>> Cleaning up old version at /usr/local/lib/ollama >>> Installing ollama to /usr/local >>> Downloading Linux amd64 bundle ######################################################################## 100.0% >>> Adding ollama user to render group... >>> Adding ollama user to video group... >>> Adding current user to ollama group... >>> Creating ollama systemd service... >>> Enabling and starting ollama service... >>> NVIDIA GPU installed. ``` ollama run deepcoder ollama ps ```shell NAME ID SIZE PROCESSOR UNTIL deepcoder:latest 12bdda054d23 10 GB 47%/53% CPU/GPU 4 minutes from now ``` ### OS Linux ### GPU Nvidia ### CPU AMD ### Ollama version 0.6.5
GiteaMirror added the bug label 2026-04-29 02:23:11 -05:00
Author
Owner

@upworkangelos commented on GitHub (Apr 14, 2025):

edit the ollama system service file and make the owner root

<!-- gh-comment-id:2800805332 --> @upworkangelos commented on GitHub (Apr 14, 2025): edit the ollama system service file and make the owner root
Author
Owner

@Johnreidsilver commented on GitHub (Apr 15, 2025):

seems to be working now after reboot

-rw-r--r-- 1 root root 348 Apr 11 10:26 /etc/systemd/system/ollama.service

<!-- gh-comment-id:2804632828 --> @Johnreidsilver commented on GitHub (Apr 15, 2025): seems to be working now after reboot -rw-r--r-- 1 root root 348 Apr 11 10:26 /etc/systemd/system/ollama.service
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#53205