0 0 votes
Article Rating

AMD GPU:amdgpu(开源驱动)

描述:AMD 的 amdgpu 内核模块(Radeon 系列的现代驱动)提供对 GPU 寄存器的直接访问,类似于 msr。它通过 debugfs 接口暴露寄存器读写,支持 MMIO(Memory-Mapped I/O)操作,用于调试硬件寄存器(如性能计数器、电源状态)。
加载模块:
textsudo modprobe amdgpu
(通常内核默认加载,如果未加载,可在 /etc/modprobe.d/ 配置。)
设备文件/接口:无专用 /dev 文件,但通过 debugfs 挂载点 /sys/kernel/debug/dri/0/(0 为 GPU 索引)访问。

启用 debugfs:mount -t debugfs none /sys/kernel/debug。

工具支持:

rocm-smi(ROCm 平台):AMD 的 System Management Interface,类似于 nvidia-smi。
示例:读取 GPU 寄存器值(假设寄存器偏移为 0x1234):
textrocm-smi –showhw

umr(AMD Micro-Register):专用工具,用于读写 GPU 寄存器。
安装:sudo apt install umr(Debian/Ubuntu)。
示例:
textumr -w 0 0x1234 0xVALUE # 写寄存器
umr -r 0 0x1234 # 读寄存器
(0 为 GPU ID。)

编程访问:通过 amdgpu 的 ioctl 或 debugfs 文件(如 /sys/kernel/debug/dri/0/amdgpu_regs)直接读写。

Categories: Blog

Chris

Chris

Just me, need more info?

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x