惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Security Latest
Security Latest
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
S
SegmentFault 最新的问题
Hacker News - Newest:
Hacker News - Newest: "LLM"
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
P
Privacy & Cybersecurity Law Blog
WordPress大学
WordPress大学
Know Your Adversary
Know Your Adversary
Spread Privacy
Spread Privacy
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
量子位
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tor Project blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
雷峰网
雷峰网
阮一峰的网络日志
阮一峰的网络日志
V
Visual Studio Blog
T
Threatpost
T
Tenable Blog
有赞技术团队
有赞技术团队
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
C
Cisco Blogs
H
Heimdal Security Blog
Attack and Defense Labs
Attack and Defense Labs
A
About on SuperTechFans
Last Week in AI
Last Week in AI
N
News and Events Feed by Topic
T
Threat Research - Cisco Blogs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
I
Intezer
V
V2EX
Cyberwarzone
Cyberwarzone
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
B
Blog RSS Feed
V
Vulnerabilities – Threatpost
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
U
Unit 42
PCI Perspectives
PCI Perspectives
P
Privacy International News Feed
D
Docker

博客园 - 三瑞

python3 在vscode 中调试 OpenClaw 能检测到浏览器,却弹不出窗口?Ubuntu 24.04 问题全复盘与终极解决 问题现象 idea 安装cline openclaw 允许局域网能访问 VirtualBox 共享文件夹配置指南(Ubuntu 24.04 不重启方案) Nginx+Bearer Key 保护 Ollama + OpenClaw 远程连接 ubuntu24.04 安装 vscode Ubuntu 24.04 安装 KVM 完整指南 Ubuntu 启动卡顿 2 分钟?一条命令解决 Linux下Ollama + AMD ROCm GPU加速安装实操指南 Ubuntu 24.04 挂载第二块磁盘并扩展 LVM 系统盘 openclaw qqbot 反复提示 ubuntu 终端代理设置 干货|xrdp 无人值守+同屏稳定配置(Ubuntu 22.04/24.04 实测可用) openclaw 使用不同的模型 AMD GPU (RX 7900 XTX) 使用情况查看 Ubuntu 24.04 自带GNOME RDP远程连不上?一招解决xrdp残留冲突问题 Ubuntu 24.04 磁盘空间管理:从查看到 LVM 动态扩容完整指南 避坑指南完整版:OpenClaw 连接 Ollama 详细实战教程 Windows 连接 Ubuntu XRDP 远程桌面 QQ机器人接入OpenClaw完整指南:从零开始打造你的智能助手 VirtualBox U盘识别问题完美解决指南 ——记一次从入门到放弃再到入门的折腾历程 Ubuntu 系统 root 密码忘记怎么办?一招教你轻松重置 VirtualBox Ubuntu 虚拟机安装增强功能完整指南 HTTP 错误 500.21 - Internal Server Error 处理程序“BlockViewHandler”在其模块列表中有一个错误模块“ManagedPipelineHandler” 达梦数据库(DM)通过数据库类型生成修改字段类型的语句
干货|Ubuntu 24.04 + AMD 7900 XTX 24G:Ollama 纯 Vulkan 加速部署(免 ROCm)
三瑞 · 2026-03-28 · via 博客园 - 三瑞

前言

Ollama 对 AMD 显卡默认依赖 ROCm,但配置复杂、依赖冲突多(你之前已遇)。7900 XTX (Navi31) 在 Ubuntu 24.04 可直接用 Ollama 内置 Vulkan 加速,免装 ROCm,24GB 显存满血跑 30B+ 模型,速度快、稳定性高。本文全命令、零废话、一步到位。

一、环境与优势

  • 硬件:AMD RX 7900 XTX 24GB(Navi31)
  • 系统:Ubuntu 24.04 LTS(桌面 / 服务器均可)
  • 加速:Ollama 原生 Vulkan(免 ROCm、免编译、免依赖地狱)
  • 效果:显存 24GB 全识别,GPU 100% 占用,跑 32B 量化模型流畅
  • 端口:11434(可局域网访问)

二、前置:系统与驱动(1 分钟)

Ubuntu 24.04 自带 AMD 开源驱动(RADV),完美支持 7900 XTX Vulkan。

# 1. 更新系统
sudo apt update && sudo apt upgrade -y

# 2. 安装 Vulkan 基础库(必须,Ollama 依赖)
sudo apt install -y libvulkan1 mesa-vulkan-drivers vulkan-tools

# 3. 验证 Vulkan(看到 7900 XTX 即成功)
vulkaninfo | grep "GPU"

输出含:Radeon RX 7900 XTX (RADV NAVI31)

三、安装 Ollama(官方脚本)

# 一键安装(官方)
curl -fsSL https://ollama.com/install.sh | sh

# 安装后将用户加入 render 组(GPU 权限)
sudo usermod -aG render $USER
newgrp render

四、核心:启用 Vulkan 加速(关键!)

不设置则默认用 CPU。直接修改 systemd 服务:

# 编辑 Ollama 服务(覆盖配置)
sudo systemctl edit ollama.service

写入以下内容(直接复制):

[Service]
# 强制启用 Vulkan(核心)
Environment="OLLAMA_VULKAN=1"
# 监听所有网卡(局域网访问)
Environment="OLLAMA_HOST=0.0.0.0:11434"
# 允许跨域(WebUI/客户端调用)
Environment="OLLAMA_ORIGINS=*"
# 取消 HSA 重写(避免干扰 Vulkan)
Environment="HSA_OVERRIDE_GFX_VERSION="

保存退出,重启服务:

sudo systemctl daemon-reload
sudo systemctl restart ollama
sudo systemctl enable ollama  # 开机自启

五、验证:7900 XTX Vulkan 生效(必查)

# 实时查看日志
journalctl -u ollama -f

关键成功行:

inference compute" id=00000000-0300-0000-0000-000000000000 library=Vulkan name=Vulkan0 description="Radeon RX 7900 XTX (RADV NAVI31)" total="24.0 GiB" available="23.4 GiB"
  • ✅ 识别到 7900 XTX
  • ✅ 加速:Vulkan
  • ✅ 显存:24GB 全可用
  • ✅ 监听:0.0.0.0:11434(局域网可访问)

六、防火墙:放行 11434(局域网必备)

sudo ufw allow 11434/tcp
sudo ufw reload

七、跑模型:7900 XTX 24GB 推荐清单

1. 32B 级(24GB 完美)

# Qwen 2.5 32B 4-bit量化(速度最快、通用最强)
ollama run qwen2.5:32b-q4_K_M

# 代码专用(你之前要的 coder)
ollama run qwen2.5-coder:32b-q4_K_M

# Llama 3 70B 量化(极限,24GB 刚好)
ollama run llama3:70b-q4_K_M

2. 轻量(快速测试)

ollama run qwen2.5:7b  # 秒启

八、GPU 监控(确认满载)

# 安装监控工具
sudo apt install -y radeontop

# 运行(跑模型时看 GPU 100%、显存 15–22GB)
radeontop

九、局域网访问(其他设备调用)

  1. 查本机 IP:
hostname -I  # 例:192.168.1.100
  1. 其他设备(Windows/macOS/Linux):
# 终端连接
export OLLAMA_HOST=http://192.168.1.100:11434
ollama run qwen2.5-coder:32b-q4_K_M

# 网页测试
http://192.168.1.100:11434  # 显示 Ollama is running

十、常见问题(避坑)

  1. 仍用 CPU:

    • 必查:OLLAMA_VULKAN=1 已写入服务
    • 必做:sudo systemctl restart ollama
    • 验证:journalctl -u ollama -f 看 Vulkan 行
  2. 显存不足:

    • 用 q4_K_M 量化(32B 仅占~16GB)
    • 不要跑 fp16 原版(32B 需~64GB)
  3. 依赖报错(如之前 ROCm 冲突):

    # 彻底清理 ROCm(如装过)
    sudo apt purge -y rocm* amdgpu*
    sudo apt autoremove -y
    sudo rm -rf /etc/ld.so.conf.d/rocm.conf
    

十一、总结(一句话)

Ubuntu 24.04 + 7900 XTX:装 Vulkan 库 → 装 Ollama → 设 OLLAMA_VULKAN=1 → 重启,免 ROCm、24GB 满血、32B 流畅、局域网可用,5 分钟搞定。


要不要我把以上所有命令整合成一键脚本,你直接复制运行就能完成全部部署?