This was tough, and took forever to get working but it seems to be good now.
### References
- [Setup ROCm on Fedora](https://fedoraproject.org/wiki/SIGs/HC#Installation)
- NOTE: [AMD Official Docs](https://rocm.docs.amd.com/en/latest/deploy/linux/index.html) did NOT work for me.
- Setup a Python Virtual Environment
- Install Python latest version ()
- Important: Cuda did not work for me unless I did [this].
- Export HSA_OVERRIDE_GFX_VERSION=10.3.0
- My GPU (RX 6950 XT) is LLVM Target gfx1030
---
## Install ROCm on Fedora 38
```bash
# To enable access to GPU resources for non-root users, the users must be added to the video or render group. The AMD ROCm Installation Guide and FAQs recommend the video group for all ROCm-supported operating systems.
# To add the current user to the video group
sudo usermod -a -G video $LOGNAME
# To check for ROCm support of the running HW, you can install and run `rocminfo`:
sudo dnf install rocminfo
rocminfo
# OpenCL
# ROCm OpenCL can be installed with:
sudo dnf install rocm-opencl
# As well, `rocm-clinfo` or `clinfo` can be installed to verify it is working, e.g.:
sudo dnf install rocm-clinfo
rocm-clinfo
# HIP
# HIP is included in Fedora 39 and is pending for Fedora 38. For Fedora 38, you will need to add --enable-repo=updates-testing to dnf if it's not available yet.
sudo dnf install rocm-hip
# Export HSA_OVERRIDE_GFX_VERSION
# 6950 XT has LLVM Target gfx1030, hence set to 10.3.0
# Adjust for your GPU LLVM Target
export HSA_OVERRIDE_GFX_VERSION=10.3.0 >> ~/.bashrc
source ~/.bashrc
```
---
## Install PyTorch
```bash
# Install a Python virtual environment
mkdir pytorch && cd pytorch/
python -m venv .venv
source .venv/bin/activate
# Install PyTorch
# Preview (Nightly), Linux, Pip, Python, ROCm 5.6
pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm5.6
```