[Exchange and share] 【有效了】R7 7840HS APU 780m核显配置pytorch和rocm
Tofloor
poster avatar
neko
deepin
Ecological co-builder
2023-11-16 17:05
Author

现在可以玩了,见新帖:https://bbs.deepin.org.cn/post/272254

~~直接跳最后,ROCM并不支持APU,必须要有个独显。~~~~

安装pytorch,直接参考pytorch官方的文档

pip3 install --user --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm5.7

安装rocm

wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \
    gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
# ROCm repository for focal
sudo tee /etc/apt/sources.list.d/rocm.list <<'EOF'
deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/debian focal main
EOF
sudo apt update
sudo apt install rocm-hip-sdk
sudo gpasswd -a $USER render
sudo gpasswd -a $USER video
reboot #重启

验证:

780m核显可以在bios设置为16G显存😏

再跑个pytorch的官方实例测试一下。

  1. CPU含集显的机型请将HIP_VISIBLE_DEVICES=0改为1
  2. HSA_OVERRIDE_GFX_VERSION这里根据自己显卡型号进行修改:
  • HSA_OVERRIDE_GFX_VERSION=9.0.6对应显卡型号: Radeon VII
  • HSA_OVERRIDE_GFX_VERSION=10.3.0对应显卡型号:RX5000 / 6000系列
  • HSA_OVERRIDE_GFX_VERSION=11.0.0对应显卡型号:RX7000系列

我的是780m核显所以得添加环境变量

export HIP_VISIBLE_DEVICES=0
export HSA_OVERRIDE_GFX_VERSION=11.0.0

~~最后测试了一下发现其实并没有调用核显,实际上是用cpu跑的。一调用核显就报HIP错误,如果全部卸载重新安装第一次调用疑似生效了,因为屏幕立马黑屏说明核显被占用了。但重启后依然HIP报错。最后在看到ROCM的官方文档上写着“note: The integrated GPUs of Ryzen are not officially supported targets for ROCm.”~~

~~看来只能用windows 的ML曲线救国了XD,难绷。~~

Reply Favorite View the author
All Replies
black_white_bear
deepin
2023-11-16 17:18
#1

很好!

image.png

Reply View the author
jjcui8595
deepin
2023-11-16 17:31
#2

感谢分享

Reply View the author
毛毛虫
deepin
2023-11-16 22:17
#3

6800H的机器通用吗?另外BIOS核显只能调2G啊

Reply View the author
neko
deepin
Ecological co-builder
2023-11-16 22:23
#4
毛毛虫

6800H的机器通用吗?另外BIOS核显只能调2G啊

通用的,我的7840最大可以调16G

Reply View the author
Rubbish
deepin
2023-11-16 22:59
#5

泪目,核显终于能ROCm跑深度学习了

Reply View the author
静夜思001
deepin
2023-11-17 00:24
#6

收藏了先applaud

Reply View the author
沈拙言
deepin
2024-03-03 20:40
#7

感谢,还好我没运行成功,要不然也是白费劲

Reply View the author