返回文章列表文章索引阅读全文
STARBLOG / 阅读手记
ROCm

Windows + AMD GPU, Finally Can Train Models with PyTorch

This hellish combo of Windows+AMD+ROCm+PyTorch actually got running. All it took was official ROCm and conservative PyTorch 2.9.1, dodging the mess of newer versions. Next? Finally get to try training models and AI image generation.

曦远 (DealiAxy)约 8 分钟
目录7 个章节

Preface

In the previous article, I started tinkering with compiling a ROCm build of PyTorch on Windows 11. The attempt failed, but I picked up some experience along the way.

And sure enough, the very next day the build succeeded.

Build Artifacts

So good!

-a---            2026/1/5    15:58      151148776 torch-2.9.1+rocm7.11.0a20260104-cp312-cp312-win_amd64.whl
-a---            2026/1/5    15:59         514989 torchaudio-2.9.0+rocm7.11.0a20260104-cp312-cp312-win_amd64.whl
-a---            2026/1/5    16:01        1247290 torchvision-0.24.0+rocm7.11.0a20260104-cp312-cp312-win_amd64.whl

Windows + AMD + ROCm + PyTorch,

Do you even get how valuable it is to have these words together?!! 😄

Key Points

To sum it up, there were just two key points to this successful build.

Use the Official Version of ROCm

Previously, because everything I found online said AMD still hadn't released ROCm for gfx103x, I installed a third-party prebuilt version. Maybe it was too old or whatever, but compiling PyTorch kept failing.

This time I installed with this command:

pip install --index-url https://rocm.nightlies.amd.com/v2-staging/gfx103X-dgpu/ --pre rocm[libraries,devel]

You can try looking for the corresponding ROCm packages at these locations:

Don't put blind faith in third-party packages. Use the official ones if you can; if not, compile ROCm yourself. Luckily my card has an official ROCm package.

Use an Older Version of PyTorch

I mentioned this in the previous article too: the latest version might not work. I saw someone online who successfully compiled version 2.10.

I actually had a vague sense of this while struggling last time: the newer the PyTorch version, the more likely you are to hit pitfalls on the Windows + ROCm path.

People online have already confirmed:

  • 2.10: someone succeeded
  • 2.11: various uncertainties exist

This time I went straight for the more conservative option: PyTorch 2.9.1

Turns out this was the right call.

As for whether 2.11 works?

I'll mess with that later if I have the energy. For now, I'll just enjoy the results.

Installing the Wheels

Now that it's compiled, I can install and try it out.

Install these three files in order (note: torch must be installed first)

pip install .\torch-2.9.1+rocm7.11.0a20260104-cp312-cp312-win_amd64.whl
pip install .\torchvision-0.24.0+rocm7.11.0a20260104-cp312-cp312-win_amd64.whl
pip install .\torchaudio-2.9.0+rocm7.11.0a20260104-cp312-cp312-win_amd64.whl

Windows + AMD GPU: the training pipeline is now open.

What's Next?

Now that GPU acceleration works, there's a lot I can do.

Get deep learning running, start playing with AI image generation~

Next I want to try:

There's still a lot worth documenting and sharing in this series. Stay tuned.

_EOF_

Windows + AMD GPU, Finally Can Train Models with PyTorch

本文作者:
程序设计实验室
版权声明:
本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!

相关文章

讨论

共 0 条

良言一句三冬暖,恶语伤人六月寒。

加载评论中…