Open magneticflux- opened 2 days ago
I'm not actually a maintainer of ollama, but there are three others who should have received the ping.
That said, I wonder if this is fixed by https://github.com/NixOS/nixpkgs/pull/342127
Sorry for the ping, I saw your PR and thought the same thing. I've tried with and without the changes from that PR and it doesn't fix the issue.
This awful hack fixes the issue for me:
diff --git a/pkgs/by-name/ol/ollama/package.nix b/pkgs/by-name/ol/ollama/package.nix
index c1451d42faae..5f357e6035f9 100644
--- a/pkgs/by-name/ol/ollama/package.nix
+++ b/pkgs/by-name/ol/ollama/package.nix
@@ -102,7 +102,7 @@ let
# these llama-cpp binaries are unaffected by the ollama binary's DT_RUNPATH
# LD_LIBRARY_PATH is temporarily required to use the gpu
# until these llama-cpp binaries can have their runpath patched
- "--suffix LD_LIBRARY_PATH : '${addDriverRunpath.driverLink}/lib'"
+ "--suffix LD_LIBRARY_PATH : '${addDriverRunpath.driverLink}/lib:${lib.getLib cudaPackages.libcublas}/lib'"
]
++ lib.optionals enableRocm [
"--suffix LD_LIBRARY_PATH : '${rocmPath}/lib'"
I wonder if my change could be resolved by putting in LD_LIBRARY_PATH. I'll try and do some testing in the next couple days
Describe the bug
Running
ollama
fails when launching thecuda_v12
runner:/tmp/ollama1145927013/runners/cuda_v12/ollama_llama_server: error while loading shared libraries: libcublas.so.12: cannot open shared object file: No such file or directory
Steps To Reproduce
Steps to reproduce the behavior:
ollama
withnixpkgs.config.cudaSupport = true;
Expected behavior
Either
/run/opengl-driver/lib
should containlibcublas.so.12
, or theollama
wrapper should add whereverlibcublas.so
is toLD_LIBRARY_PATH
.Additional context
When starting,
ollama
also prints this warning:level=WARN source=gpu.go:669 msg="unable to locate gpu dependency libraries"
.I have 2x Quadro P5000s, using the closed drivers since open doesn't support them.
Notify maintainers
@abysssol @dit7ya @elohmeier @RoyDubnium
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.