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

推荐订阅源

V
Vulnerabilities – Threatpost
AI
AI
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
LINUX DO - 热门话题
G
GRAHAM CLULEY
Cisco Talos Blog
Cisco Talos Blog
T
Tenable Blog
L
Lohrmann on Cybersecurity
Know Your Adversary
Know Your Adversary
A
Arctic Wolf
T
Threatpost
AWS News Blog
AWS News Blog
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Cisco Blogs
F
Full Disclosure
Jina AI
Jina AI
Engineering at Meta
Engineering at Meta
I
InfoQ
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
Intezer
C
CERT Recently Published Vulnerability Notes
Last Week in AI
Last Week in AI
P
Privacy International News Feed
Scott Helme
Scott Helme
WordPress大学
WordPress大学
Simon Willison's Weblog
Simon Willison's Weblog
D
Docker
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
Y
Y Combinator Blog
T
Tor Project blog
V
Visual Studio Blog
Spread Privacy
Spread Privacy
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
Google Online Security Blog
Google Online Security Blog
C
Check Point Blog
爱范儿
爱范儿
N
News and Events Feed by Topic
博客园 - 【当耐特】
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main

Kevin Blog

产品随想 2 产品力与人才密度 产品随想 1 做营销还是做产品 Play PyTorch Stable Diffusion and ONNX, Ollama on Intel Core Ultra 5 225H Ubuntu 25.04 写在新的旅程开始前 想念自然与青春 懒猫微服体验——自由协作的神器 没有光纤的日子怎么上网?自制 Home WI-FI! Swift on Server Tour 6 关联 User 和 Post Swift on Server Tour 5 创建 Users Swift on Server Tour 4 构建 Post Controller Swift on Server Tour 3 构建 Post 的 API 将不懂的日语一拍扫尽,介绍捧读全新的「OCR 工作台」功能 Swift on Server Tour 2 连通你的数据库与服务器 Swift on Server Tour 1 你的第一个 Server App 以及它背后的故事 Swift on Server Tour 0: 为什么这可能是你的好选择 纪念左耳朵耗子 How to learn Japanese by reading Novels and News with the help of Oyomi. Write WebAssembly in Swift and use it in Swift App BenQ WiT ScreenBar Halo 体验报告 记录 2021 年考驾照的体验 捧读的 EPUB 日语轻小说阅读器来了 使用 Go Mobile 开发跨平台 Library 使用 Kotlin Native 开发跨平台 Library 小番茄 - 一个只有陪伴的自习室 保友金豪电脑椅异响维修记 青岛度假指南 2020 「捧读」更新,支持针对任意文本进行语法讲解 一次百元耳机与千元耳机的横评 高刷墨水屏的海信 A5 Pro 体验报告 「捧读」更新 Safari 扩展,轻松阅读日语网页 新 App 「捧读:日语语法学习与分析」的开发幕后思考 明基 WiT ScreenBar Plus 体验 Switch游戏推荐:「健身环大冒险」和「太鼓达人」 妥协是否是一种艺术? 「50 音起源」1.2 更新说明 作客 UX Coffee 分享了自己最近的独立开发者生活 青岛度假指南 2019 我有「快乐自由」 关于小电台这款产品 聊一聊 50 音起源的再设计 极端精英主义的崩塌 Xcode Error: CFBundleSupportedPlatforms or Mach-O LC_VERSION_MIN 自由职业一周年我收获了什么 「50音起源」从起源学习 50 音的 App iOS/Android 青岛疗养(度假)指南 关于独处的一些经验 跨省携猫🐱搬家记 关于 FilmMentor 这款小众产品的想法 选择离开北京,以及为什么可以
Play with ROCm, PyTorch, Ollama on Ubuntu 24.04 and 780m
2025-03-24 · via Kevin Blog

2025.12.25 更新

最近 rocBLAS 和 AMD 新的 TheRock 构建项目都支持了 780M(gfx1103) 的显卡,详情见这个指南

image.png

安装后我参考之前Intel XPU 体验测试了几个项目。

测试的版本

ROCm 7.1.1

Python 侧(需要注意这个对应关系,如果直接按照官方的命令安装可能出现不匹配的情况)

rocm==7.11.0a20260121
torch==2.11.0a0+rocm7.11.0a20260121
torchaudio==2.11.0a0+rocm7.11.0a20260121 
torchvision==0.25.0a0+rocm7.11.0a20260121

uv pip install torch==2.11.0a0+rocm7.11.0a20260121 rocm==7.11.0a20260121 torchaudio==2.11.0a0+rocm7.11.0a20260121 torchvision==0.25.0a0+rocm7.11.0a20260121  --index-url https://rocm.nightlies.amd.com/v2/gfx110X-all/ --pre

Pytorch

✅正常通过 CUDA 检测

import torch

print(torch.cuda.is_available())
print(torch.cuda.get_device_name(0))

Kokoro-TTS

❌错误 RuntimeError: miopenStatusUnknownError

Kokoro-ONNX

✅正常运行,可以使用 CUDA Provider

PaddleOCR

✅直接测试了原版,正常运行并启用 CUDA 加速

Ollama

✅Ollama 方面暂未支持 gfx1103,需要像之前那样用 HSA_OVERRIDE_GFX_VERSION 绕一下

Stable Diffusion

✅用了个 int8 的量化版本,成功

import torch
from diffusers import FluxPipeline

def main():
    pipe = FluxPipeline.from_pretrained(
        "diffusers/FLUX.1-dev-torchao-int8",
        torch_dtype=torch.bfloat16,
        use_safetensors=False,
        device_map="balanced"
    )
    prompt = "a lovely cat holding a sign says 'hello world'"

    out = pipe(
        prompt=prompt,
        height=512,
        width=512,
        num_inference_steps=9
    ).images[0]

    out.save("out.jpg")

if __name__ == "__main__":
    main()
100% 9/9 [01:08<00:00,  7.57s/it]
alt text

Z-Image

✅ 成功

alt text
import torch
from diffusers import ZImagePipeline

# 1. Load the pipeline
# Use bfloat16 for optimal performance on supported GPUs
pipe = ZImagePipeline.from_pretrained(
    "Tongyi-MAI/Z-Image-Turbo",
    torch_dtype=torch.bfloat16,
    low_cpu_mem_usage=False,
)
pipe.to("cuda")

prompt = "Young Chinese woman in red Hanfu, intricate embroidery. Impeccable makeup, red floral forehead pattern. Elaborate high bun, golden phoenix headdress, red flowers, beads. Holds round folding fan with lady, trees, bird. Neon lightning-bolt lamp (⚡️), bright yellow glow, above extended left palm. Soft-lit outdoor night background, silhouetted tiered pagoda (西安大雁塔), blurred colorful distant lights."

# 2. Generate Image
image = pipe(
    prompt=prompt,
    height=512  ,
    width=512,
    num_inference_steps=9,  # This actually results in 8 DiT forwards
    guidance_scale=0.0,     # Guidance should be 0 for the Turbo models
    generator=torch.Generator("cuda").manual_seed(42),
).images[0]

image.save("example.png")
100% 9/9 [00:35<00:00,  4.00s/it]
prompt = "a lovely cat holding a sign says 'hello world'"
alt text
100% 9/9 [00:33<00:00,  3.70s/it]

感觉再过些时间 780M 兼容性应该会变得更好,但从种种痕迹来看,iGPU 至少要从 Strix Halo (aka AI MAX) 开始,才算得上得到了 AMD 的重视,RuntimeError 应该是会大幅减少的


最近买了个 8845HS 的小主机,但因为 780M 的显卡并没有被 ROCm 列为官方支持的卡,所以目前需要很多 trick 来运行

最主要的就是通过 HSA_OVERRIDE_GFX_VERSION 来假装成受支持的显卡。虽然我用的都是 HSA_OVERRIDE_GFX_VERSION=11.0.2 但实际上因 ROCm 版本的不同,到底哪个能在你的显卡上工作需要自己测试下。

你可以通过 AMD 官网的 Supported GPUs 中的 Architecture 和 LLVM target 来查找,比如 gfx1101,那就是 HSA_OVERRIDE_GFX_VERSION=11.0.1

除此之外,ls /opt/rocm/lib/rocblas/library 命令也会列出一些没显示在官网上的支持,比如 11.0.2

ROCm

ROCm 是 AMD 显卡玩机器学习的基础组件,现在安装起来很简单,amdgpu-install 这个包就可以很好的解决

sudo apt install amdgpu-install
amdgpu-install --usecase=rocm

Ollama

Ollama 的运行可以参考下面的 PR Enable AMD iGPU 780M in Linux, Create amd-igpu-780m.md #5426

简而言之,直接通过这个命令就可以运行

HSA_OVERRIDE_GFX_VERSION=11.0.2 ollama serve

目前 Ollama 对 igpu 的显存支持有些问题,不能够将所有共享内存计算在内,解决方案可以参考这里 AMD integrated graphic on linux kernel 6.9.9+, GTT memory, loading freeze fix #6282

我的主要场景并非用 8845HS 来跑 LLM,所以就跑个简单的测试下吧,gemma3:12b 这个量化模型的速度大概是 8.44 tokens/s 可以说堪用

image.png

ollama ps

使用 ollama ps命令可以查看模型是分配在哪个设备上运行的。

image.png

PyTorch

PyTorch 直接通过AMD 官网提供的命令来安装即可,需要注意的是我使用 PyTorch 官网的命令安装稳定版并不能成功运行,AMD 官网给出的 nightly 版本可以。

pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.2.4/

同样,需要使用 HSA_OVERRIDE_GFX_VERSION=11.0.2 来运行,可以创建一个 .env 文件在 ipynb 里动态载入,如果是 vscode 的话,.env 文件会自动加载,不需要下述步骤

pip install python-dotenv

在 ipynb 顶部加入一个 code block 每次运行一下即可

其它内容无需修改

radeontop 监控

配置完成后,如果有时候不确定有没有跑在 GPU 上,可以用 radeontop 来监控

sudo apt install radeontop
image.png

关于 NPU

8845HS 还带了个 16 TOPS 的 NPU,不过要等到 Linux 6.14 才会合并进去。

届时 ONNX Runtime 的 VitisAIExecutionProvider 和 HuggingFace 的 RyzenAI 应该都能开箱即用。

唯一的问题是兼容性如何。

暂时还没折腾,等到时候也会测试一下再写一篇折腾的博客

其他参考

Does ROCm 5.7 support Radeon 780M (gfx1103)? #2631

Feature: ROCm Support for AMD Ryzen 9 7940HS with Radeon 780M Graphics #3398