How To guide : PyTorch/Tensorflow on AMD (ROCm) in Windows PC
Unable to install Tensorflow-rocm for Good AMD ROCm Setup - AI Discussions - DeepLearning.AI
[D] ROCm vs CUDA
What to expect from machine learning on AMD?
Videos
» pip install tensorflow-rocm
WARNING - OUTDATED & doesn't work anymore
In a classic AMD fashion, nothing below works anymore. If the new documentation is better than before, take it as a warning: AMD software & support constantly changes and you will have to very often restart from scratch.
Please refer to updated AMD doc for the latest version: https://rocm.docs.amd.com/projects/radeon-ryzen/en/latest/docs/install/installrad/wsl/howto_wsl.html
Outdated, kept here as a souvenir for emotional reasons (god have I spent hours for that, probably more than the time GPU acceleration made me gain):
A small How To guide for using pytorch/tensorflow in your windows PC on your AMD GPU
Hey everyone, since the last posts on that matter are now outdated, I figured an update could be welcome for some people. Note that I have not tried this method with tensorflow, I only added it here since there is some doc about it done by AMD.
Step 0 : have a supported GPU.
This tuto will focus on using WSL, and only a handfull of GPUs are supported. You can find the list here :
https://rocm.docs.amd.com/projects/radeon/en/latest/docs/compatibility/wsl/wsl_compatibility.html#gpu-support-matrix
This is the only GPU list that matters. If your GPU is not here you cannot use pytorch/tensorflow on windows this way.
Step 1 : Install WSL on your windows PC.
Simply follow this official guide from microsoft : https://learn.microsoft.com/en-us/windows/wsl/install
Or do it the dirty but easy way and install ubuntu 24.04 LTS from the microsoft store : https://apps.microsoft.com/detail/9NZ3KLHXDJP5?hl=neutral&gl=CH&ocid=pdpshare
To be sure, please make sure that the version you pick is supported here : https://rocm.docs.amd.com/projects/radeon/en/latest/docs/compatibility/wsl/wsl_compatibility.html#os-support-matrix
Reboot your PC
Step 2 : Install ROCm on WSL
Start WSL (you should have an ubuntu app you can launch like any other applications)
Install ROCm using this script : https://rocm.docs.amd.com/projects/radeon/en/latest/docs/install/wsl/install-radeon.html#install-amd-unified-driver-package-repositories-and-installer-script
Follow their instructions and run their scripts untill you can run the command rocminfo. It should display the model of your GPU alongside several other infos.
Reboot your PC
Step 3 : Install pytorch/tensorflow with ROCm build
For pytorch, you should straight up follow this guide : https://rocm.docs.amd.com/projects/radeon/en/latest/docs/install/wsl/install-pytorch.html#install-methods
For tensorflow, you first need to install MIGraphX : https://rocm.docs.amd.com/projects/radeon/en/latest/docs/install/native_linux/install-migraphx.html and then tensorflow for rocm : https://rocm.docs.amd.com/projects/radeon/en/latest/docs/install/native_linux/install-tensorflow.html#pip-installation
Step 4 : Enjoy
You should have everything set to start working. I've personally set up a jupyter server on WSL ( https://harshityadav95.medium.com/jupyter-notebook-in-windows-subsystem-for-linux-wsl-8b46fdf0a536 ) allowing me to connect to it from VSCode.
This was mainly a wrap up of already existing doc by AMD. Thumbs up to them as their doc was improved a lot since I first tried it. Hope this helps ! Hopefully, you'll be one day able to use pytorch with rocm without WSL on more gpus, you can follow this issue if you're interested in it -> https://github.com/pytorch/pytorch/issues/109204