[GH-ISSUE #7483] Packaging ollama: make including ROCm libraries in the dist optional #51269

Closed
opened 2026-04-28 19:08:50 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @breezerider on GitHub (Nov 3, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7483

Originally assigned to: @dhiltgen on GitHub.

While working on a package for ollama built with a ROCm runner, I noticed that by default the build scripts include all the dependencies in dist archive. It makes sense in case of a standalone build, but when dependencies are resolved via a package manager, this adds a superfluous archive that in case of ROCm dependencies increase package size significantly. Till now I have been patching the build system to remove this step but as the build system changes this takes more effort. Would it be OK to optionally skip including library dependencies in the dist? I am willing to work on a patch for ROCm.

Originally created by @breezerider on GitHub (Nov 3, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7483 Originally assigned to: @dhiltgen on GitHub. While working on a package for ollama built with a ROCm runner, I noticed that by default the build scripts include all the dependencies in dist archive. It makes sense in case of a standalone build, but when dependencies are resolved via a package manager, this adds a superfluous archive that in case of ROCm dependencies increase package size significantly. Till now I have been patching the build system to remove this step but as the build system changes this takes more effort. Would it be OK to optionally skip including library dependencies in the dist? I am willing to work on a patch for ROCm.
GiteaMirror added the buildfeature request labels 2026-04-28 19:08:51 -05:00
Author
Owner

@dhiltgen commented on GitHub (Nov 3, 2024):

I think it makes sense to refactor the makefiles a bit so that we can split out dependency gathering for distribution in the official bundles as a discrete target (or set of targets) so users or downstream apps/packaging can omit that step.

<!-- gh-comment-id:2453585194 --> @dhiltgen commented on GitHub (Nov 3, 2024): I think it makes sense to refactor the makefiles a bit so that we can split out dependency gathering for distribution in the official bundles as a discrete target (or set of targets) so users or downstream apps/packaging can omit that step.
Author
Owner

@nikhil-swamix commented on GitHub (Nov 6, 2024):

will this be a good philosophy like pip listaller (reference)
pip install ollama[cuda]
pip install ollama[rocm]
maybe apt get something similar ?
where would the issue arise in the official installer?

<!-- gh-comment-id:2458957051 --> @nikhil-swamix commented on GitHub (Nov 6, 2024): will this be a good philosophy like pip listaller (reference) `pip install ollama[cuda]` `pip install ollama[rocm]` maybe `apt get something similar` ? where would the issue arise in the official installer?
Author
Owner

@breezerider commented on GitHub (Nov 7, 2024):

@nikhil-swamix I don't believe there should be any issue for existing installers
Just to be clear, I asked to be able to build without putting GPU libraries into the dist, so being able to do something like:
make OLLAMA_DONT_PUT_GPU_LIBS_IN_DIST=1
I don't see how or why this should affect existing installers. But his would help package ollama for Linux distributions (like Debian, Ubuntu, Fedora, etc) where respective library dependencies are resolved via a package manager. As rocBLAS with all Tensile kernels can easily be ~1-2GBs, having those libraries twice on the system is superfluous (one copy coming from the package dependency and another copy residing in the dist).

<!-- gh-comment-id:2461441186 --> @breezerider commented on GitHub (Nov 7, 2024): @nikhil-swamix I don't believe there should be any issue for existing installers Just to be clear, I asked to be able to build without putting GPU libraries into the dist, so being able to do something like: `make OLLAMA_DONT_PUT_GPU_LIBS_IN_DIST=1` I don't see how or why this should affect existing installers. But his would help package ollama for Linux distributions (like Debian, Ubuntu, Fedora, etc) where respective library dependencies are resolved via a package manager. As rocBLAS with all Tensile kernels can easily be ~1-2GBs, having those libraries twice on the system is superfluous (one copy coming from the package dependency and another copy residing in the dist).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#51269