Radeon Open Compute (ROCm)
ROCm is focused on using AMD GPUs to accelerate computational tasks such as machine learning, engineering workloads, and scientific computing. - github / Doc / HN
Confirm You Have a ROCm-Capable GPU (v5.0)
- ROCm officially supports AMD GPUs that use following chips:
- GFX8 GPUs / “Polaris 10” chips, such as on the AMD Radeon RX 580
- ROCm does not support gf8 devices officially. ROCm works on some gfx8 devices; however, it is not officially tested and validated.
- Installation of ROCm and TensorFlow on Ubuntu 20.4 LTS for Radeon RX580 - 2023
ROCm Installation
ROCm Installation Guide v5.4.2 - Ubuntu v22.04 - current setup
Testing the ROCm Installation
After restarting the system, run the following commands to verify that the ROCm installation is successful. If you see your GPUs listed, you are good to go!
Run sudo apt install mesa-opencl-icd
to fix it:
Consider nvtop
ROCm Libraries
This is needed to compile code using ROCm => “fatal error: ‘hipblas/hipblas.h’ file not found”
ROCm Examples
- missing lib hipcub => TBD
Older notes
- In this guide we stick to ROCm 3.5.1 - AMD dropped official support for the RX580 - Pytorch - 1.7.0a0+898eb06 - ROCm version: 3.5.1
Kernel installation for GPU support
Go with docker image (so that python/tensorflow version can be isolated)
Alternatives
PlaidML
As a component under Keras, PlaidML can accelerate training workloads with customized or automatically-generated Tile code. It works especially well on GPUs, and it doesn’t require use of CUDA/cuDNN on Nvidia hardware, while achieving comparable performance.
OpenCL
- using AMD GPU - OpenCL