Last active
May 2, 2025 12:29
-
-
Save neuhaus/2fc66f9b1ebaa08ff95a527b91556113 to your computer and use it in GitHub Desktop.
Restart ollama docker container if it no longer detects the nvidia GPU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# restart ollama docker container if GPU is no longer recognized. | |
# call this script once per minute with cron. | |
if docker logs --since 63s ollama 2>&1 | grep -q "ggml_cuda_init: failed to initialize CUDA: no CUDA-capable device is detected"; then | |
docker restart ollama | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment