[GH-ISSUE #2436] Unable to load dynamic server library in hardened environment (tmp mounted as noexec) #63460

Closed
opened 2026-05-03 13:37:05 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @crenz on GitHub (Feb 9, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2436

I installed ollama on a hardened Ubuntu 22 system successfully. When running ollama run mistral, I am getting the following error message:

Error: Unable to load dynamic library: Unable to load dynamic server library: /tmp/ollama2322208974/cpu_avx2/libext_server.so: failed to map segment from shared object

The root cause seems to be that on this system, /tmp is mounted as noexec. I was able to fix the issue by setting another temporary directory in /etc/systemd/system/ollama.service by adding the line

Environment="TMPDIR=/usr/share/ollama/tmp"

I suggest addressing the issue by using a temporary directory within the /usr/share/ollama directory if /tmpis mounted as noexec, or to at least mention this issue in the documentation.

Originally created by @crenz on GitHub (Feb 9, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2436 I installed ollama on a hardened Ubuntu 22 system successfully. When running `ollama run mistral`, I am getting the following error message: `Error: Unable to load dynamic library: Unable to load dynamic server library: /tmp/ollama2322208974/cpu_avx2/libext_server.so: failed to map segment from shared object` The root cause seems to be that on this system, `/tmp` is mounted as noexec. I was able to fix the issue by setting another temporary directory in `/etc/systemd/system/ollama.service` by adding the line `Environment="TMPDIR=/usr/share/ollama/tmp"` I suggest addressing the issue by using a temporary directory within the `/usr/share/ollama` directory if `/tmp`is mounted as noexec, or to at least mention this issue in the documentation.
Author
Owner

@PaulHendi commented on GitHub (Feb 13, 2024):

I had a similar issue, and in my case just updating Ollama fixed it :)

<!-- gh-comment-id:1942046663 --> @PaulHendi commented on GitHub (Feb 13, 2024): I had a similar issue, and in my case just updating Ollama fixed it :)
Author
Owner

@hoyyeva commented on GitHub (Mar 11, 2024):

Hey @crenz, really sorry you ran into that problem. Could you check if the update to Ollama sorted it out for you? We're going to close this issue for now, but if you're still stuck, please let us know!

<!-- gh-comment-id:1989097584 --> @hoyyeva commented on GitHub (Mar 11, 2024): Hey @crenz, really sorry you ran into that problem. Could you check if the update to Ollama sorted it out for you? We're going to close this issue for now, but if you're still stuck, please let us know!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#63460