AMDMIGraphX

(โ˜… 327)

AMD's graph optimization engine.

Showing a partial file list โ€” download the zip above to see everything.

  • .clang-format
  • .clang-tidy
  • .dockerignore
  • .gitignore
  • .readthedocs.yaml
  • AGENTS.md
  • CHANGELOG.md
  • CMakeLists.txt
  • codecov.yml
  • dev-requirements.txt
  • Dockerfile
  • hip-clang.docker
  • Jenkinsfile
  • LICENSE
  • rbuild.ini
  • README.md
  • requirements.txt
  • SECURITY.md

# Installation Guide

1. Get the code
git clone https://github.com/ROCm/AMDMIGraphX

Downloads the entire project code from GitHub to your computer.

cd AMDMIGraphX

Moves into the project folder you just downloaded.

2. Official Install Script

Easy Recommended
Prerequisites
  • APT (Debian/Ubuntu ๊ณ„์—ด) Built into Debian/Ubuntu-based Linux distributions.
  • Python 3 Python is required to use pip.
sudo apt install -y rocm-cmake python3-pip rocblas miopen-hip

Installs directly from the APT package repository (Debian/Ubuntu-based).

pip install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz

Installs the package published on PyPI directly โ€” no need to clone the source.

โœ… After installing, open a new terminal and run the program's version command (e.g. --version) to confirm it worked.

Pulled directly from this repo's README.

3. Docker

Easy
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Docker Desktop Needed to build and run containers. Install it and keep it running in the background.
docker build -t migraphx .

Builds a runnable image based on the Dockerfile.

docker build -t migraphx --build-arg GPU_ARCH=$(rocminfo | grep -o -m1 'gfx.*') .

Builds a runnable image based on the Dockerfile.

docker run --device='/dev/kfd' --device='/dev/dri' -v=`pwd`:/code/AMDMIGraphX -w /code/AMDMIGraphX --group-add video -it migraphx

Runs the built image as an actual container.

docker build -t migraphx:legacy -f tools/docker/legacy.dockerfile .

Builds a runnable image based on the Dockerfile.

docker build -t migraphx:2404 -f tools/docker/ubuntu_2404.dockerfile .

Builds a runnable image based on the Dockerfile.

โœ… Run docker compose ps to check the containers are Up. If the README mentions a port, open http://localhost:PORT in your browser.

Pulled directly from this repo's README.

4. CMake

Medium
Prerequisites
  • Git Needed to download the project code from GitHub.
  • CMake The tool used to generate build configuration.
  • C/C++ ์ปดํŒŒ์ผ๋Ÿฌ Windows needs Visual Studio (Community edition, free), macOS needs Xcode Command Line Tools, Linux needs the gcc/g++ package.
sudo apt install -y rocm-cmake python3-pip rocblas miopen-hip

Installs directly from the APT package repository (Debian/Ubuntu-based).

CXX=/opt/rocm/llvm/bin/clang++ cmake .. -DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')

Type this command into your terminal and run it.

CXX=/opt/rocm/llvm/bin/clang++ cmake .. \

Type this command into your terminal and run it.

This puts all the prerequisites are in `depend` the folder. They can be used in the `cmake`

Type this command into your terminal and run it.

Otherwise, you need to set `-DCMAKE_PREFIX_PATH=$your_loc` to configure CMake.

Type this command into your terminal and run it.

โœ… Check that an executable was created inside the build folder, then run it directly (e.g. ./build/app_name).

Pulled directly from this repo's README.

5. Python

Easy
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Python 3 On Windows, be sure to check 'Add Python to PATH' during installation.
sudo apt install -y rocm-cmake python3-pip rocblas miopen-hip

Installs directly from the APT package repository (Debian/Ubuntu-based).

python3 -m venv venv_rbuild

Runs the Python script (or module).

pip install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz

Installs the package published on PyPI directly โ€” no need to clone the source.

pip3 install -r sphinx/requirements.txt

Installs the Python libraries listed in requirements.txt (or similar).

python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html

Runs the Python script (or module).

โœ… If it runs without errors and prints output in the terminal, it worked.

Pulled directly from this repo's README.

// repository documentation