1.背景
torch官网支持AMD显卡的whl都是linux平台的,访问下面链接直接Ctrl + F,搜ROCM,都是linux平台的。
Torchhttps://download.pytorch.org/whl/torch/windows版本的都要编译,而且ROCM也只是linux平台的,要想在windows下搞AI,只能安装HIP SDK,两者差异如下:
官方文档链接如下:
ROCm components supported in HIP SDK — HIP SDK for Windows 7.2.0 documentationROCm component supporthttps://rocm.docs.amd.com/projects/install-on-windows/en/latest/conceptual/component-support.html但是不是所有的AMD显卡都受ROCM的支持,哪些显卡可以使用官方ROCM参考下面的列表:
System requirements for Windows — HIP SDK for Windows 7.2 documentationWindows GPU and OS supporthttps://rocm.docs.amd.com/projects/install-on-windows/en/develop/reference/system-requirements.html可以看到780M这种集成显卡并不在支持列表里面,官方文档也说了,如果GPU没在列表,说明不受官方支持。
如果显卡在里面,直接访问下面链接下载ROCM:
AMD HIP SDK for WindowsDownload the AMD ROCm HIP SDK for Windows.https://www.amd.com/en/developer/resources/rocm-hub/hip-sdk.html如果显卡不在列表内,只能自己编译或者使用别人编译好的Rocm。对于个人使用,首选肯定是别人编译好的Rocm,比如:
GitHub - likelovewant/ROCmLibs-for-gfx1103-AMD780M-APU: ROCm Library Files for gfx1103 and update with others arches based on AMD GPUs for use in Windows. · GitHubROCm Library Files for gfx1103 and update with others arches based on AMD GPUs for use in Windows. - GitHub - likelovewant/ROCmLibs-for-gfx1103-AMD780M-APU: ROCm Library Files for gfx1103 and update with others arches based on AMD GPUs for use in Windows.https://github.com/likelovewant/ROCmLibs-for-gfx1103-AMD780M-APU
他就是从官网代码编译出支持780M的库。
另外有人直接通关AMD github官方仓库https://github.com/ROCm/TheRock (这个仓库就是编译框架)编译出的二进制安装程序,比如下面的仓库:
https://github.com/guinmoon/rocm7_builds不光提供了rocm,还提供了编译好的torch版本,真可谓是良心。
这位大佬写了文章较怎么编译的:
https://medium.com/@guinmoon/building-rocm-7-1-and-pytorch-on-windows-for-unsupported-gpus-my-hands-on-guide-0758d2d2b334
文章里面也给了几个链接,应该是官方编译的非正式版本:
- https://rocm.nightlies.amd.com/v2-staging/
- https://rocm.nightlies.amd.com/v2/
- https://rocm.devreleases.amd.com/v2
- https://rocm.devreleases.amd.com/v2-staging
我在里面翻了翻,已经有编译好的支持780M显卡(1103)的WHL(rocm以及pytorch)。
2.实际测试
未完待续。