赞
踩
docker pull ollama/ollama
docker run -d --restart=always -v /home/docker/ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
# nvidia-container-runtime-script.sh
sudo curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
sudo curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | \
sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
sudo apt-get update
运行上述指令
##运行等待事件较长
sudo sh nvidia-container-runtime-script.sh
##要想成功执行这句,必须把源做好。
sudo apt-get install nvidia-container-runtime
#验证
which nvidia-container-runtime
#重启docker
sudo systemctl restart docker
#指定gpu模板
docker run -it --gpus '"device=0,2"' --shm-size 32g image_name:tag_name
docker run --gpus all -d -v /your/path/docker/ollama:/root/.ollama -p 11435:11435 --name ollama-gpu ollama/ollama
docker pull ghcr.io/open-webui/open-webui:main
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
这一步是为了在windows端可以访问
ssh -N -L 3000:localhost:3000 linux@linux.ip
docker ps -l
#会返回CONTAINER ID,假设ed01c65da2cf
docker rm ed01c65da2cf
## 将登陆用户加入到docker用户组中
sudo gpasswd -a $USER docker
# 更新用户组
newgrp docker
sudo apt-get install -y nvidia-docker2 Reading package lists... Done
Building dependency tree Reading state information... Error! E:
Unable to parse package file /var/lib/apt/extended_states (1)
extended_states 做好备份,删除这个文件后,执行
sudo apt-get update
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。