网站首页 > 精选文章 正文
首先要能下载docker的镜像,这点自己想办法吧
参考
https://github.com/ollama/ollama/blob/main/docs/docker.md
我利用自己的笔记本安装了个centos7(为啥不用ubuntu,因为本人对centos熟点),上面有个1050ti的显卡
一. Centos7安装NVIDIA显卡驱动
[root@jxgm7 docker]# lspci | grep -i vga
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile)
01:00.0 VGA compatible controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1)
有个核显,一个独显
二.更新系统并安装依赖
yum update kernel
yum install kernel-devel gcc -y
reboot
三.屏蔽掉nouveau
这个结合了网上的两点,
修改dist-blacklist.conf文件
vim /lib/modprobe.d/dist-blacklist.conf
将nvidiafb注释掉:
#blacklist nvidiafb
然后添加以下语句:
blacklist nouveau
options nouveau modeset=0
修改/etc/default/grub 文件
重建initramfs image
备份 mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak
重建 dracut /boot/initramfs-$(uname -r).img $(uname -r)
重启 reboot
四.安装NVIDIA驱动
1.在NVIDIA官网下载驱动
网址
:https://www.nvidia.cn/Download/index.aspx?lang=cn
我下载的是
NVIDIA-Linux-x86_64-550.54.14.run
2.切换到命令行界面
init 3
3.安装NVIDIA驱动
chmod +x NVIDIA-Linux-x86_64-550.54.14.run
./NVIDIA-Linux-x86_64-550.54.14.run
查看安装结果
nvidia-smi
五.用docker安装ollama
1.centos安装docker-ce
# 设置docker镜像源
yum-config-manager \
--add-repo \
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sed -i 's/download.docker.com/mirrors.aliyun.com\/docker-ce/g' /etc/yum.repos.d/docker-ce.repo
yum makecache fast
yum install -y docker-ce
2.安装NVIDIA Container Toolkit.
yum install -y nvidia-container-toolkit
nvidia-ctk runtime configure --runtime=docker
systemctl restart docker
3.安装ollama镜像
docker run -d --gpus=all -v /root/docker/ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
4.安装openweb-ui
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v /root/docker/open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
5.下载模型等
我这里下载了llama3.1与qwen2等模型,
执行命令是
docker exec -it ollama ollama run llama3.1
docker exec -it ollama ollama run qwen2
打开http://ip:3000之后,登录完选择模型,即可对话了
另外,跑llama3.1:70b的时候显示内存不够,以后有机会再换机器吧
- 上一篇: MySQL系列-YUM及RPM包安装(v5.7.34)
- 下一篇: Qt开发经验小技巧181-185
猜你喜欢
- 2025-04-26 centos7 Linux-yum只离线下载不安装方式
- 2025-04-26 Step by Step之CentOS7安装Selenium篇
- 2025-04-26 急死!CPU被挖矿了,却找不到哪个进程
- 2025-04-26 使用ISO文件搭建本地yum源
- 2025-04-26 yum源配置方法跟linux常用命令
- 2025-04-26 【Linux】——从0到1的学习,让你熟练掌握,带你玩转Linu
- 2025-04-26 CentOS下通过yum搭建lnmp(单版本PHP)
- 2025-04-26 CentOS系统搭建本地源,摆脱无公网环境下的软件安装难题
- 2025-04-26 黑客技术linux/yum在线管理安装
- 2025-04-26 VMware与CentOS安装配置指南
- 最近发表
- 标签列表
-
- 向日葵无法连接服务器 (32)
- git.exe (33)
- vscode更新 (34)
- dev c (33)
- git ignore命令 (32)
- gitlab提交代码步骤 (37)
- java update (36)
- vue debug (34)
- vue blur (32)
- vscode导入vue项目 (33)
- vue chart (32)
- vue cms (32)
- 大雅数据库 (34)
- 技术迭代 (37)
- 同一局域网 (33)
- github拒绝连接 (33)
- vscode php插件 (32)
- vue注释快捷键 (32)
- linux ssr (33)
- 微端服务器 (35)
- 导航猫 (32)
- 获取当前时间年月日 (33)
- stp软件 (33)
- http下载文件 (33)
- linux bt下载 (33)