Skip to content

Commit

Permalink
Added an install section and removed index and search from index page
Browse files Browse the repository at this point in the history
  • Loading branch information
spolifroni-amd committed Sep 11, 2024
1 parent b6b228c commit aff7f41
Show file tree
Hide file tree
Showing 9 changed files with 218 additions and 10 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# AMD MIGraphX

AMD MIGraphX is AMD's graph inference engine, which accelerates machine learning model inference.
To use MIGraphX, you can install the binaries or build from source code. Refer to the following sections
for Ubuntu installation instructions (we'll provide instructions for other Linux distributions in the future).


> [!NOTE]
> You must [install ROCm](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/index.html) before
Expand All @@ -16,7 +14,7 @@ Install binaries using:
sudo apt update && sudo apt install -y migraphx
```

Header files and libraries are installed under `/opt/rocm-<version>`, where `<version>` is the ROCm
Header files and libraries are installed under ``/opt/rocm-<version>``, where ``<version>`` is the ROCm
version.

## Building from source
Expand Down
15 changes: 9 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ Our documentation is structured as follows:
.. grid:: 2
:gutter: 3

.. grid-item-card:: Install

* :doc:`Prerequisites <./install/prerequisites>`
* :doc:`Tested configurations <./install/tested_configurations>`
* :doc:`Install MIGraphX <./install/install>`
* :doc:`Build and install MIGraphX with Docker <./install/build_and_install_with_docker>`
* :doc:`Build and install MIGraphX with Docker <./install/build_and_install_with_cmake>`
* :doc:`Build and install MIGraphX with Docker <./install/build_and_install_with_rbuild>`

.. grid-item-card:: Reference

* :ref:`cpp-api-reference`
Expand All @@ -30,9 +39,3 @@ To contribute to the documentation refer to

Licensing information can be found on the
`Licensing <https://rocm.docs.amd.com/en/latest/about/license.html>`_ page.

Index and search
==================

* :ref:`genindex`
* :ref:`search`
62 changes: 62 additions & 0 deletions docs/install/build_and_install_with_cmake.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.. meta::
:description: Build and install MIGraphX using CMake
:keywords: build, install, MIGraphX, AMD, ROCm, CMake

********************************************************************
Build and install MIGraphX using CMake
********************************************************************

ROCm must be installed before installing MIGraphX. See `ROCm installation for Linux <https://rocm.docs.amd.com/projects/install-on-linux/en/latest/>`_ for information on how to install ROCm on Linux.

.. note::

This method for building MIGraphX requires using ``sudo``.


1. Install the dependencies:

.. code:: shell
sudo rbuild build -d depend -B build -DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
.. note::

If ``rbuild`` is not installed on your system, install it with:

.. code:: shell
pip3 install --prefix /usr/local https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
2. Create a build directory and change directory to it:

.. code:: shell
mkdir build
cd build
3. Configure CMake:

.. code:: shell
CXX=/opt/rocm/llvm/bin/clang++ cmake .. -DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
4. Build MIGraphX source code:

.. code:: shell
make -j$(nproc)
You can verify this using:

.. code:: shell
make -j$(nproc) check
5. Install MIGraphX libraries:

.. code:: shell
make install
52 changes: 52 additions & 0 deletions docs/install/build_and_install_with_docker.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.. meta::
:description: Installing MIGraphX using Docker
:keywords: install, MIGraphX, AMD, ROCm, Docker

********************************************************************
Installing MIGraphX using Docker
********************************************************************

ROCm must be installed before installing MIGraphX. See `ROCm installation for Linux <https://rocm.docs.amd.com/projects/install-on-linux/en/latest/>`_ for information on how to install ROCm on Linux.

.. note::

Docker commands are run using ``sudo``.

1. Build the Docker image. This command will install all the prerequisites required to install MIGraphX. Ensure that you are running this in the same directory as ``Dockerfile``.

.. code:: shell
sudo docker build -t migraphx .
2. Create and run the container. Once this command is run, you will be in the ``/code/AMDMIGraphX`` directory of a pseudo-tty.

.. code:: shell
sudo docker run --device='/dev/kfd' --device='/dev/dri' -v=`pwd`:/code/AMDMIGraphX -w /code/AMDMIGraphX --group-add video -it migraphx
3. In the ``/code/AMDMIGraphX``, create a ``build`` directory, then change directory to ``/code/AMDMIGraphX/build``:

.. code:: shell
mkdir build
cd build
4. Configure CMake:

.. code:: shell
CXX=/opt/rocm/llvm/bin/clang++ cmake .. -DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
4. Build the MIGraphX libraries:

.. code:: shell
make -j$(nproc)
5. Install the libraries:

.. code:: shell
make install
32 changes: 32 additions & 0 deletions docs/install/build_and_install_with_rbuild.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.. meta::
:description: Build and install MIGraphX using rbuild
:keywords: build, install, MIGraphX, AMD, ROCm, rbuild

********************************************************************
Build and install MIGraphX using rbuild
********************************************************************

ROCm must be installed before installing MIGraphX. See `ROCm installation for Linux <https://rocm.docs.amd.com/projects/install-on-linux/en/latest/>`_ for information on how to install ROCm on Linux.

.. note::

This method for building MIGraphX requires using ``sudo``.

1. Install `rocm-cmake`, `pip3`, `rocblas`, and `miopen-hip`:

.. code:: shell
sudo apt install -y rocm-cmake python3-pip rocblas miopen-hip
2. Install `rbuild <https://github.com/RadeonOpenCompute/rbuild>`_:

.. code:: shell
pip3 install --prefix /usr/local https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
3. Build MIGraphX source code:

.. code:: shell
sudo rbuild build -d depend -B build -DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
19 changes: 19 additions & 0 deletions docs/install/install.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. meta::
:description: Installing MIGraphX
:keywords: install, MIGraphX, AMD, ROCm

********************************************************************
Installing MIGraphX using binaries
********************************************************************

ROCm must be installed before installing MIGraphX. See `ROCm installation for Linux <https://rocm.docs.amd.com/projects/install-on-linux/en/latest/>`_ for information on how to install ROCm on Linux.

All prerequisites needed to install MIGraphX are installed when the package install is used.

MIGraphX can be installed using the following command:

.. code:: shell
sudo apt update && sudo apt install -y migraphx
22 changes: 22 additions & 0 deletions docs/install/prerequisites.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. meta::
:description: MIGraphX Installation Prerequisites
:keywords: install, MIGraphX, AMD, ROCm, prerequisites, dependencies, requirements

********************************************************************
MIGraphX Installation prerequisites
********************************************************************

The following components and tools must be installed before MIGraphX can be installed.

The installation steps include installing these dependencies.

* `ROCm CMake <https://github.com/RadeonOpenCompute/rocm-cmake>`_
* `MIOpen <https://github.com/ROCmSoftwarePlatform/MIOpen>`_
* `rocBLAS <https://github.com/ROCmSoftwarePlatform/rocBLAS>`_
* `HIP <https://github.com/ROCm-Developer-Tools/HIP>`_
* `Protobuf <https://github.com/google/protobuf>`_
* `Half <http://half.sourceforge.net/>`_
* `pybind11 <https://pybind11.readthedocs.io/en/stable/>`_
* `JSON <https://github.com/nlohmann/json>`_
* `MessagePack <https://msgpack.org/index.html>`_
* `SQLite3 <https://www.sqlite.org/index.html>`_
10 changes: 10 additions & 0 deletions docs/install/tested_configurations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. meta::
:description: MIGraphX tested configurations.
:keywords: install, MIGraphX, AMD, ROCm, configurations

********************************************************************
MIGraphX Tested configurations
********************************************************************

MIGraphX has been tested using the following ROCm system requirements:

10 changes: 10 additions & 0 deletions docs/sphinx/_toc.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ root: index
subtrees:
- entries:
- file: what-is-migraphx

- caption: Installation
entries:

- file: install/tested_configurations
- file: install/prerequisites
- file: install/install
- file: install/build_and_install_with_cmake
- file: install/build_and_install_with_docker
- file: install/build_and_install_with_rbuild

- caption: Reference
entries:
- file: reference/cpp
Expand Down

0 comments on commit aff7f41

Please sign in to comment.