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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 三瑞

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。

bash

运行

# 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(官方脚本)

bash

运行

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

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

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

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

bash

运行

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

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

ini

[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="

保存退出,重启服务:

bash

运行

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

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

bash

运行

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

关键成功行:

plaintext

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(局域网必备)

bash

运行

sudo ufw allow 11434/tcp
sudo ufw reload

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

1. 32B 级(24GB 完美)

bash

运行

# 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. 轻量(快速测试)

bash

运行

ollama run qwen2.5:7b  # 秒启

八、GPU 监控(确认满载)

bash

运行

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

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

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

  1. 查本机 IP:

bash

运行

hostname -I  # 例:192.168.1.100
  1. 其他设备(Windows/macOS/Linux):

bash

运行

# 终端连接
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 冲突):

    bash

    运行

    # 彻底清理 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 分钟搞定。

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