[GH-ISSUE #10053] GPU Usage Issue After Sleep Mode or Hibernation #68649

Closed
opened 2026-05-04 14:44:36 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @viba1 on GitHub (Mar 30, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10053

What is the issue?

When the PC is first started, Ollama correctly utilizes the GPU for its computations. However, after the system enters sleep mode and resumes, Ollama stops using the GPU and switches to the CPU, resulting in a significant drop in performance. This issue makes it difficult to use Ollama in scenarios requiring continuous GPU utilization.

Configuration:
NVIDIA RTX 3000 series
AMD Ryzen 7000 series
Ollama 0.6.3
NVIDIA DRIVER 535.216.01
Linux DEBIAN 12 (6.1.0-32-amd64)
Graphical server: X11

Steps to Reproduce:
Start the PC.
Launch Ollama and confirm that the GPU is being used (e.g., via nvidia-smi or a monitoring tool).
Put the PC into sleep mode.
Wake up the PC and relaunch Ollama.

Expected Result:
Ollama should continue to use the GPU after resuming from sleep mode, just as it does after the initial startup.

Observed Result:
After resuming from sleep mode, Ollama no longer utilizes the GPU and instead switches to the CPU, leading to degraded performance.
Restarting the ollama server doesn't resolve this issue. Only a complete host PC restart solve this issue, until the next sleep mode...

Relevant log output

After a complete host restart:

time=2025-03-30T22:37:36.301+02:00 level=INFO source=gpu.go:217 msg="looking for compatible GPUs"
time=2025-03-30T22:37:36.388+02: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"
time=2025-03-30T22:37:36.388+02:00 level=INFO source=amd_linux.go:296 msg="unsupported Radeon iGPU detected skipping" id=0 total="512.0 MiB"
time=2025-03-30T22:37:36.388+02:00 level=INFO source=amd_linux.go:402 msg="no compatible amdgpu devices detected"
time=2025-03-30T22:37:36.388+02:00 level=INFO source=types.go:130 msg="inference compute" id=GPU-de62092c-e3b8-44ce-f072-b0499aee9a56 library=cuda variant=v12 compute=8.6 driver=12.2 name="NVIDIA GeForce RTX 30xx" total="15.7 GiB" available="15.1 GiB"

After sleep mode:

time=2025-03-30T22:28:24.091+02:00 level=WARN source=gpu.go:605 msg="unknown error initializing cuda driver library /usr/lib/x86_64-linux-gnu/nvidia/current/libcuda.so.535.216.01: cuda driver library init failure: 999. see https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md for more information"

time=2025-03-30T22:28:24.107+02:00 level=INFO source=amd_linux.go:296 msg="unsupported Radeon iGPU detected skipping" id=0 total="512.0 MiB"
time=2025-03-30T22:28:24.107+02:00 level=INFO source=amd_linux.go:402 msg="no compatible amdgpu devices detected"
time=2025-03-30T22:28:24.107+02:00 level=INFO source=gpu.go:377 msg="no compatible GPUs were discovered"

OS

Linux

GPU

Nvidia

CPU

AMD

Ollama version

0.6.3

Originally created by @viba1 on GitHub (Mar 30, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10053 ### What is the issue? When the PC is first started, Ollama correctly utilizes the GPU for its computations. However, after the system enters sleep mode and resumes, Ollama stops using the GPU and switches to the CPU, resulting in a significant drop in performance. This issue makes it difficult to use Ollama in scenarios requiring continuous GPU utilization. Configuration: NVIDIA RTX 3000 series AMD Ryzen 7000 series Ollama 0.6.3 NVIDIA DRIVER 535.216.01 Linux DEBIAN 12 (6.1.0-32-amd64) Graphical server: X11 Steps to Reproduce: Start the PC. Launch Ollama and confirm that the GPU is being used (e.g., via nvidia-smi or a monitoring tool). Put the PC into sleep mode. Wake up the PC and relaunch Ollama. Expected Result: Ollama should continue to use the GPU after resuming from sleep mode, just as it does after the initial startup. Observed Result: After resuming from sleep mode, Ollama no longer utilizes the GPU and instead switches to the CPU, leading to degraded performance. Restarting the ollama server doesn't resolve this issue. Only a complete host PC restart solve this issue, until the next sleep mode... ### Relevant log output After a complete host restart: ```shell time=2025-03-30T22:37:36.301+02:00 level=INFO source=gpu.go:217 msg="looking for compatible GPUs" time=2025-03-30T22:37:36.388+02: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" time=2025-03-30T22:37:36.388+02:00 level=INFO source=amd_linux.go:296 msg="unsupported Radeon iGPU detected skipping" id=0 total="512.0 MiB" time=2025-03-30T22:37:36.388+02:00 level=INFO source=amd_linux.go:402 msg="no compatible amdgpu devices detected" time=2025-03-30T22:37:36.388+02:00 level=INFO source=types.go:130 msg="inference compute" id=GPU-de62092c-e3b8-44ce-f072-b0499aee9a56 library=cuda variant=v12 compute=8.6 driver=12.2 name="NVIDIA GeForce RTX 30xx" total="15.7 GiB" available="15.1 GiB" ``` After sleep mode: ```shell time=2025-03-30T22:28:24.091+02:00 level=WARN source=gpu.go:605 msg="unknown error initializing cuda driver library /usr/lib/x86_64-linux-gnu/nvidia/current/libcuda.so.535.216.01: cuda driver library init failure: 999. see https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md for more information" time=2025-03-30T22:28:24.107+02:00 level=INFO source=amd_linux.go:296 msg="unsupported Radeon iGPU detected skipping" id=0 total="512.0 MiB" time=2025-03-30T22:28:24.107+02:00 level=INFO source=amd_linux.go:402 msg="no compatible amdgpu devices detected" time=2025-03-30T22:28:24.107+02:00 level=INFO source=gpu.go:377 msg="no compatible GPUs were discovered" ``` ### OS Linux ### GPU Nvidia ### CPU AMD ### Ollama version 0.6.3
GiteaMirror added the bug label 2026-05-04 14:44:36 -05:00
Author
Owner

@rick-github commented on GitHub (Mar 30, 2025):

https://github.com/ollama/ollama/blob/main/docs/gpu.md#linux-suspend-resume

<!-- gh-comment-id:2764652886 --> @rick-github commented on GitHub (Mar 30, 2025): https://github.com/ollama/ollama/blob/main/docs/gpu.md#linux-suspend-resume
Author
Owner

@viba1 commented on GitHub (Mar 30, 2025):

"sudo rmmod nvidia_uvm && sudo modprobe nvidia_uvm" systematically leads to "rmmod: ERROR: Module nvidia_uvm is in use".
This is not a solution or even a viable workaround. What is the root cause and associated fix?
Furthermore, the troubleshooting you mention says "sometimes Ollama will fail to discover your NVIDIA GPU", but the problem is reproducible every time the session is locked.

<!-- gh-comment-id:2764730487 --> @viba1 commented on GitHub (Mar 30, 2025): "sudo rmmod nvidia_uvm && sudo modprobe nvidia_uvm" systematically leads to "rmmod: ERROR: Module nvidia_uvm is in use". This is not a solution or even a viable workaround. What is the root cause and associated fix? Furthermore, the troubleshooting you mention says "sometimes Ollama will fail to discover your NVIDIA GPU", but the problem is reproducible every time the session is locked.
Author
Owner

@rick-github commented on GitHub (Mar 30, 2025):

https://github.com/ollama/ollama/issues/5464#issuecomment-2605816642

<!-- gh-comment-id:2764732970 --> @rick-github commented on GitHub (Mar 30, 2025): https://github.com/ollama/ollama/issues/5464#issuecomment-2605816642
Author
Owner

@viba1 commented on GitHub (Mar 30, 2025):

Switching to the latest nvidia driver (570.133.07) improves the situation a little.
Thanks for your answer.
Probably duplicated with https://github.com/ollama/ollama/issues/5464#issuecomment-2605816642

<!-- gh-comment-id:2764767158 --> @viba1 commented on GitHub (Mar 30, 2025): Switching to the latest nvidia driver (570.133.07) improves the situation a little. Thanks for your answer. Probably duplicated with https://github.com/ollama/ollama/issues/5464#issuecomment-2605816642
Author
Owner

@rick-github commented on GitHub (Mar 30, 2025):

Let us know if it does actually improve the situation, then we can update the FAQ with a better workaround than unload/loading a module.

<!-- gh-comment-id:2764768025 --> @rick-github commented on GitHub (Mar 30, 2025): Let us know if it does actually improve the situation, then we can update the FAQ with a better workaround than unload/loading a module.
Author
Owner

@pdevine commented on GitHub (Mar 31, 2025):

I'll close the bug as a dupe, but feel free to keep commenting.

<!-- gh-comment-id:2767117164 --> @pdevine commented on GitHub (Mar 31, 2025): I'll close the bug as a dupe, but feel free to keep commenting.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#68649