先说一下我的环境,我用的操作系统是centos stream 9,显卡是p40,本地ollama+open-webui。
我的open-webui是去年7月份用python3.11下的pip命令装的,版本是0.3.8。有些新功能如本地知识库没有,现在想升级到最新0.5.20,体验新功能,没想到升级过程并不顺利,记流水帐如下。
$ conda activate py311 #进虚环境
如果网速不好,一定换国内源,如下:
$ pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
$ pip install --upgrade open-webui #升级
升级过程装了一大堆依赖包,后边还有个包不正常,提示错误:
langchain-chroma 0.1.1 requires chromadb<0.6.0,>=0.4.0, but you have chromadb 0.6.2 which is incompatible.
langchain-chroma 0.1.1 requires langchain-core<0.3,>=0.1.40, but you have langchain-core 0.3.41 which is incompatible.
解决办法:尝试降低chromadb版本号,open-webui不能运行,只好安装langchain-chroma包的最新版本。
但是不知道最新版本号,到https://pypi.org/网站,搜索框上输入langchain-chroma,点击放大镜搜出来,点击langchain-chroma进去,发现最新版本是0.2.2,复制安装命令并执行:
$ pip install langchain-chroma==0.2.2
安装完后再装open-webui,没有出错。但是运行起来特慢。
检查后发现原来是ollama闹情绪,没有使用显卡:
# nvidia-smi #执行后提示驱动没装,重启系统故障依旧,莫名其妙,只好重装显卡驱动,发现原旧驱动包安装不成功。
解装办法是重新安装最新驱动。
# systemctl stop ollama #停止ollama开始装驱动。
升级显卡驱动
以下是重装驱动步骤:
先到这里下载最新驱动:https://cn.download.nvidia.cn/,要选择你的显卡系列和型号比如tesla P40对应操作系统如Linux x86-64位的系统,对应的CUDA默认12.8最新。如果选了红帽linux9并下载rpm包的话,也不好使。下载最新版本:NVIDIA-Linux-x86_64-570.124.06.run
下载等待过程中,先装装依赖包:
# yum install kernel #升级kernel
# yum -y install kernel-devel
# yum -y install kernel-headers
# yum -y install epel-release
# yum -y install dkms
# lsmod | grep nouveau #检查这个开源的nouveau有没有运行,如果有运行,需要搞掉它。无输出表示没有运行。
以上为更新所需的依赖包,安装过程会同时把别的依赖包装上。
下载完最新版本NVIDIA-Linux-x86_64-570.124.06.run后:
# chmod +x NVIDIA-Linux-x86_64-570.124.06.run #添加执行权限
# ./NVIDIA-Linux-x86_64-570.124.06.run #运行安装程序,一路默认选项。
# nvidia-smi #执行命令,显示正常了就行。如果不正常还需要再试试下载不同的驱动,没有别的办法,我在这里卡了好久,一度怀疑显卡是不是坏了:)。
再把ollama运行起来:
# systemctl start ollama
# su - admin
$ conda activate py311
$ open-webui --help #忘记后面的参数了,查查帮助。
Usage: open-webui [OPTIONS] COMMAND [ARGS]...
╭─ Options
│ --install-completion Install completion for the current shell.
│ --show-completion Show completion for the current shell, to copy it or customize the installation.
│ --help Show this message and exit.
╭─ Commands
│ dev
│ main
│ serve
$ open-webui serve #启动openwebui,体验新功能去。
附:再次更新ollama
ollama版本层出不穷,有时能更新有时不能。最近找到新的下载安装地址:curl https://ollama.ai/install.sh | sh 还没有被屏蔽
安装完成后到/usr/local/bin目录下:
ollama -v #检查版本号
mv ollama ollama.0.5.7 #更改文件名
ln -sf ollama.0.5.7 ollama#建立链接文件
systemctl restart ollama.service#重启服务
ollama run deepseek-r1:latest #测试运行模型/bye退出