Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission issue for /start_ollama in dustynv/ollama:0.4.0-r36.4.0 #742

Open
intelemodelseth opened this issue Dec 9, 2024 · 8 comments

Comments

@intelemodelseth
Copy link

intelemodelseth commented Dec 9, 2024

Attempting the documented jetson-containers run --name ollama $(autotag ollama)
with dustynv/ollama:0.4.0-r36.4.0 on both a Jetson AGX Xavier dev kit and Jetson AGX Orin dev kit results in the same error:

/bin/sh: 1: /start_ollama: Permission denied

It is unclear how I might resolve this without the dockerfile being adjusted.

@intelemodelseth
Copy link
Author

intelemodelseth commented Dec 9, 2024

intelemodel@ubuntu:~$ jetson-containers run --name ollama $(autotag ollama)
Namespace(packages=['ollama'], prefer=['local', 'registry', 'build'], disable=[''], user='dustynv', output='/tmp/autotag', quiet=False, verbose=False)
-- L4T_VERSION=36.4.0  JETPACK_VERSION=6.1  CUDA_VERSION=12.6
-- Finding compatible container image for ['ollama']

Found compatible container dustynv/ollama:0.4.0-r36.4.0 (2024-11-09, 3.3GB) - would you like to pull it? [Y/n] Y
dustynv/ollama:0.4.0-r36.4.0
V4L2_DEVICES:
+ sudo docker run --runtime nvidia -it --rm --network host --shm-size=8g --volume /tmp/argus_socket:/tmp/argus_socket --volume /etc/enctune.conf:/etc/enctune.conf --volume /etc/nv_tegra_release:/etc/nv_tegra_release --volume /tmp/nv_jetson_model:/tmp/nv_jetson_model --volume /var/run/dbus:/var/run/dbus --volume /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket --volume /var/run/docker.sock:/var/run/docker.sock --volume /home/intelemodel/jetson-containers/data:/data -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro --device /dev/snd -e PULSE_SERVER=unix:/run/user/1000/pulse/native -v /run/user/1000/pulse:/run/user/1000/pulse --device /dev/bus/usb --device /dev/i2c-0 --device /dev/i2c-1 --device /dev/i2c-2 --device /dev/i2c-3 --device /dev/i2c-4 --device /dev/i2c-5 --device /dev/i2c-6 --device /dev/i2c-7 --device /dev/i2c-8 --device /dev/i2c-9 --name ollama dustynv/ollama:0.4.0-r36.4.0
[sudo] password for intelemodel:
Unable to find image 'dustynv/ollama:0.4.0-r36.4.0' locally
0.4.0-r36.4.0: Pulling from dustynv/ollama
a186900671ab: Pull complete
8341bb9e50df: Pull complete
91c93038087e: Pull complete
f97768af92a0: Pull complete
102653227cae: Pull complete
52595ca88337: Pull complete
94f1946bedfc: Pull complete
ed8f29c189c4: Pull complete
38046f0c1fe3: Pull complete
b195513fabfb: Pull complete
4a9a90b74561: Pull complete
7a64e4b65531: Pull complete
Digest: sha256:395aef2cc3992b3b5a111cf76bb6573dc14a961d4214623d3bbf5759e5a9f5b2
Status: Downloaded newer image for dustynv/ollama:0.4.0-r36.4.0
/bin/sh: 1: /start_ollama: Permission denied
intelemodel@ubuntu:~$ ll /tmp/nv_jetson_model
-rw-rw-r-- 1 intelemodel intelemodel 37 Dec  9 13:26 /tmp/nv_jetson_model

@intelemodelseth
Copy link
Author

Freshly flashed AGX Orin 64Gb developer's kit.

intelemodel@ubuntu:~/Desktop$ jetson-containers run --name ollama $(autotag ollama)
Namespace(packages=['ollama'], prefer=['local', 'registry', 'build'], disable=[''], user='dustynv', output='/tmp/autotag', quiet=False, verbose=False)
-- L4T_VERSION=36.4.0  JETPACK_VERSION=6.1  CUDA_VERSION=12.6
-- Finding compatible container image for ['ollama']
dustynv/ollama:0.4.0-r36.4.0
V4L2_DEVICES: 
### DISPLAY environmental variable is already set: ":1"
localuser:root being added to access control list
xauth:  file /tmp/.docker.xauth does not exist
+ docker run --runtime nvidia -it --rm --network host --shm-size=8g --volume /tmp/argus_socket:/tmp/argus_socket --volume /etc/enctune.conf:/etc/enctune.conf --volume /etc/nv_tegra_release:/etc/nv_tegra_release --volume /tmp/nv_jetson_model:/tmp/nv_jetson_model --volume /var/run/dbus:/var/run/dbus --volume /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket --volume /var/run/docker.sock:/var/run/docker.sock --volume /home/intelemodel/Desktop/jetson-containers/data:/data -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro --device /dev/snd -e PULSE_SERVER=unix:/run/user/1000/pulse/native -v /run/user/1000/pulse:/run/user/1000/pulse --device /dev/bus/usb -e DISPLAY=:1 -v /tmp/.X11-unix/:/tmp/.X11-unix -v /tmp/.docker.xauth:/tmp/.docker.xauth -e XAUTHORITY=/tmp/.docker.xauth --device /dev/i2c-0 --device /dev/i2c-1 --device /dev/i2c-2 --device /dev/i2c-3 --device /dev/i2c-4 --device /dev/i2c-5 --device /dev/i2c-6 --device /dev/i2c-7 --device /dev/i2c-8 --device /dev/i2c-9 --name ollama dustynv/ollama:0.4.0-r36.4.0
/bin/sh: 1: /start_ollama: Permission denied

@intelemodelseth
Copy link
Author

Following the instructions from: https://www.jetson-ai-lab.com/tutorial_ollama.html
Ollama can't start due to the permission error, but Open-WebUI's commands ran without issue. It seems that Docker engine is running ok, but something is still requiring permission updates for the build with the Ollama container.

@intelemodelseth
Copy link
Author

I may be inexperienced with Docker, but it seems that the Dockerfile is missing a WORKDIR, and there is no USER definition use in the Dockerfile. Could this be the source of the permission issue?

@shouji000
Copy link

I try to change the official image in the following ways:
docker run -it --entrypoint /bin/bash dustynv/ollama:0.4.0-r36.4.0
ls -l /start_ollama
chmod +x start_ollama
exit
docker container ls -a
docker commit <container_id> my_ollama:0.4.0-r36.4.0
jetson-containers run my_ollama:0.4.0-r36.4.0
The error seems to be solved. But in the container ,i run "ollama serve", ollama cann't start
image

@dusty-nv
Copy link
Owner

@intelemodelseth @shouji000 here is my latest ollama image dustynv/ollama:0.5.1-r36.4.0 , the permission issue is fixed
`

@intelemodelseth
Copy link
Author

@intelemodelseth @shouji000 here is my latest ollama image dustynv/ollama:0.5.1-r36.4.0 , the permission issue is fixed `

Success! Thank you very much for this, much appreciated!

@shouji000
Copy link

dustynv/ollama:0.5.1-r36.4.0

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants