[GH-ISSUE #6647] can't use nvidia GPU only after sleep #29943

Closed
opened 2026-04-22 09:18:09 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @brookate on GitHub (Sep 5, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6647

What is the issue?

after gentoo linux sleep, ollama only use cpu
turn on OOLAMA_DEBUG, I find such line

time=2024-09-05T09:20:35.622+08:00 level=DEBUG source=gpu.go:521 msg="discovered GPU libraries" paths="[/tmp/ollama786265597/runners/cuda_v11/libcudart.so.11.0 /opt/cuda/lib64/libcudart.so.12.6.37]"
cudaSetDevice err: 999
time=2024-09-05T09:20:35.624+08:00 level=DEBUG source=gpu.go:533 msg="Unable to load cudart" library=/tmp/ollama786265597/runners/cuda_v11/libcudart.so.11.0 error="cudart init failure: 999"
cudaSetDevice err: 999
time=2024-09-05T09:20:35.627+08:00 level=DEBUG source=gpu.go:533 msg="Unable to load cudart" library=/opt/cuda/lib64/libcudart.so.12.6.37 error="cudart init failure: 999"

my cuda is
dell➜ ~ cd /opt/cuda
dell➜ cuda l
total 88K
drwxr-xr-x 6 root root 4.0K Aug 28 10:01 .
drwxr-xr-x 14 root root 4.0K Aug 26 18:22 ..
-rw-r--r-- 1 root root 62K Aug 28 10:00 EULA.txt
drwxr-xr-x 3 root root 4.0K Aug 28 10:01 bin
lrwxrwxrwx 1 root root 28 Aug 28 10:00 include -> targets/x86_64-linux/include
lrwxrwxrwx 1 root root 24 Aug 28 10:00 lib64 -> targets/x86_64-linux/lib
drwxr-xr-x 3 root root 4.0K Jul 31 18:53 nvml
drwxr-xr-x 6 root root 4.0K Jul 31 18:53 nvvm
drwxr-xr-x 3 root root 4.0K Jul 31 18:53 targets
dell➜ cuda cd targets/x86_64-linux/lib
dell➜ lib ls libcudart.so
libcudart.so@ libcudart.so.12@ libcudart.so.12.6.37*

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.3.0

Originally created by @brookate on GitHub (Sep 5, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6647 ### What is the issue? after gentoo linux sleep, ollama only use cpu turn on OOLAMA_DEBUG, I find such line ``` time=2024-09-05T09:20:35.622+08:00 level=DEBUG source=gpu.go:521 msg="discovered GPU libraries" paths="[/tmp/ollama786265597/runners/cuda_v11/libcudart.so.11.0 /opt/cuda/lib64/libcudart.so.12.6.37]" cudaSetDevice err: 999 time=2024-09-05T09:20:35.624+08:00 level=DEBUG source=gpu.go:533 msg="Unable to load cudart" library=/tmp/ollama786265597/runners/cuda_v11/libcudart.so.11.0 error="cudart init failure: 999" cudaSetDevice err: 999 time=2024-09-05T09:20:35.627+08:00 level=DEBUG source=gpu.go:533 msg="Unable to load cudart" library=/opt/cuda/lib64/libcudart.so.12.6.37 error="cudart init failure: 999" ``` my cuda is dell➜ ~ cd /opt/cuda dell➜ cuda l total 88K drwxr-xr-x 6 root root 4.0K Aug 28 10:01 . drwxr-xr-x 14 root root 4.0K Aug 26 18:22 .. -rw-r--r-- 1 root root 62K Aug 28 10:00 EULA.txt drwxr-xr-x 3 root root 4.0K Aug 28 10:01 bin lrwxrwxrwx 1 root root 28 Aug 28 10:00 include -> targets/x86_64-linux/include lrwxrwxrwx 1 root root 24 Aug 28 10:00 lib64 -> targets/x86_64-linux/lib drwxr-xr-x 3 root root 4.0K Jul 31 18:53 nvml drwxr-xr-x 6 root root 4.0K Jul 31 18:53 nvvm drwxr-xr-x 3 root root 4.0K Jul 31 18:53 targets dell➜ cuda cd targets/x86_64-linux/lib dell➜ lib ls libcudart.so libcudart.so@ libcudart.so.12@ libcudart.so.12.6.37* ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.3.0
GiteaMirror added the bug label 2026-04-22 09:18:09 -05:00
Author
Owner

@brookate commented on GitHub (Sep 5, 2024):

Ok, I find a way after some search.

sudo rmmod nvidia_uvm
sudo modprobe nvidia_uvm

it works to me.

<!-- gh-comment-id:2330433043 --> @brookate commented on GitHub (Sep 5, 2024): Ok, I find a way after some search. ``` sudo rmmod nvidia_uvm sudo modprobe nvidia_uvm ``` it works to me.
Author
Owner

@dhiltgen commented on GitHub (Sep 5, 2024):

Poor suspend/resume behavior on nvidia GPUs is tracked via #5464

<!-- gh-comment-id:2332156618 --> @dhiltgen commented on GitHub (Sep 5, 2024): Poor suspend/resume behavior on nvidia GPUs is tracked via #5464
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#29943