2022-11-10 15:14:39 -06:00
# Deployment
2022-11-04 14:49:36 -05:00
```eval_rst
.. toctree::
:glob:
:maxdepth: 4
```
2024-05-09 14:17:49 +00:00
## Install Omniperf from source
2022-11-04 14:49:36 -05:00
Omniperf is broken into two installation components:
1. **Omniperf Client-side (_Required_)**
- Provides core application profiling capability
2024-03-25 12:13:13 -05:00
- Allows collection of performance counters, filtering by hardware block, dispatch, kernel, etc
2022-11-04 14:49:36 -05:00
- CLI based analysis mode
- Stand alone web interface for importing analysis metrics
2. **Omniperf Server-side (_Optional_)**
- Mongo DB backend + Grafana instance
2023-08-29 10:56:25 -05:00
- Packaged in a Docker container for easy setup
2022-11-04 14:49:36 -05:00
2024-01-31 16:05:12 -06:00
Determine what you need to install based on how you would like to interact with Omniperf. See the decision tree below to help determine what installation is right for you.
2023-08-14 12:58:33 -05:00
2024-03-26 12:54:51 -05:00

2023-08-14 12:58:33 -05:00
2022-11-04 14:49:36 -05:00
---
2024-05-09 14:17:49 +00:00
### Client-side Installation
2022-11-04 14:49:36 -05:00
2023-08-14 12:58:33 -05:00
Omniperf client-side requires the following basic software dependencies prior to usage:
2022-11-04 14:49:36 -05:00
2024-02-27 14:55:23 -06:00
* Python (>=3.8)
2022-11-04 14:49:36 -05:00
* CMake (>= 3.19)
2024-02-27 14:55:23 -06:00
* ROCm (>= 5.7.1)
2022-11-04 14:49:36 -05:00
In addition, Omniperf leverages a number of Python packages that are
documented in the top-level `requirements.txt` file. These must be
2024-03-27 15:42:04 -05:00
installed prior to Omniperf configuration.
2024-04-01 12:46:54 -05:00
```{admonition} Optional packages
If you would like to build Omniperf as a developer, consider these additional requirements:
| Requirement file | Description |
| --------------------- | -------------------------------------------------------------- |
| requirements-doc.txt | Python packages required to build docs from source |
| requirements-test.txt | Python packages required to run Omniperf's CI suite via PyTest |
2024-03-27 15:42:04 -05:00
` ``
2022-11-04 14:49:36 -05:00
The recommended procedure for Omniperf usage is to install into a shared file system so that multiple users can access the final installation. The following steps illustrate how to install the necessary python dependencies using [pip](https://packaging.python.org/en/latest/) and Omniperf into a shared location controlled by the ` INSTALL_DIR` environment variable.
` ``{admonition} Configuration variables
The following installation example leverages several
[CMake](https://cmake.org/cmake/help/latest/) project variables
defined as follows:
| Variable | Description |
| -------------------- | -------------------------------------------------------------------- |
| CMAKE_INSTALL_PREFIX | controls install path for Omniperf files |
| PYTHON_DEPS | provides optional path to resolve Python package dependencies |
| MOD_INSTALL_PATH | provides optional path for separate Omniperf modulefile installation |
2022-11-04 16:56:24 -05:00
` ``
A typical install will begin by downloading the latest release tarball
available from the
2024-03-21 11:14:37 -04:00
[Releases](https://github.com/ROCm/omniperf/releases) section
2022-11-04 16:56:24 -05:00
of the Omniperf development site. From there, untar and descend into
the top-level directory as follows:
2024-01-31 16:05:12 -06:00
` ``shell-session
2022-11-04 16:56:24 -05:00
$ tar xfz omniperf-v{__VERSION__}.tar.gz
$ cd omniperf-v{__VERSION__}
2022-11-04 14:49:36 -05:00
` ``
2022-11-04 16:56:24 -05:00
Next, install Python dependencies and complete the Omniperf configuration/install process as follows:
2024-01-31 16:05:12 -06:00
` ``shell-session
2022-11-04 14:49:36 -05:00
# define top-level install path
2022-11-04 16:56:24 -05:00
$ export INSTALL_DIR=<your-top-level-desired-install-path>
2022-11-04 14:49:36 -05:00
# install python deps
2022-11-07 17:23:07 -06:00
$ python3 -m pip install -t ${INSTALL_DIR}/python-libs -r requirements.txt
2022-11-04 14:49:36 -05:00
# configure Omniperf for shared install
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}/{__VERSION__} \
-DPYTHON_DEPS=${INSTALL_DIR}/python-libs \
-DMOD_INSTALL_PATH=${INSTALL_DIR}/modulefiles ..
# install
$ make install
` ``
2022-11-04 16:56:24 -05:00
` ``{tip}
You may require ` sudo` during the final install step if you
2022-11-05 08:42:11 -05:00
do not have write access to the chosen install path.
2022-11-04 16:56:24 -05:00
` ``
2022-11-04 14:49:36 -05:00
After completing these steps, a successful top-level installation directory looks as follows:
2024-01-31 16:05:12 -06:00
` ``shell-session
2022-11-04 14:49:36 -05:00
$ ls $INSTALL_DIR
modulefiles {__VERSION__} python-libs
` ``
2024-05-09 14:17:49 +00:00
#### Execution using modulefiles
2022-11-04 16:56:24 -05:00
2022-11-04 14:49:36 -05:00
The installation process includes creation of an environment
modulefile for use with [Lmod](https://lmod.readthedocs.io). On
systems that support Lmod, a user can register the Omniperf modulefile
directory and setup their environment for execution of Omniperf as
follows:
2024-01-31 16:05:12 -06:00
` ``shell-session
2022-11-04 14:49:36 -05:00
$ module use $INSTALL_DIR/modulefiles
$ module load omniperf
$ which omniperf
/opt/apps/omniperf/{__VERSION__}/bin/omniperf
$ omniperf --version
ROC Profiler: /opt/rocm-5.1.0/bin/rocprof
omniperf (v{__VERSION__})
` ``
2023-06-06 11:01:37 -04:00
` ``{tip} Users relying on an Lmod Python module locally may wish to
2022-11-04 14:49:36 -05:00
customize the resulting Omniperf modulefile post-installation to
include additional module dependencies.
` ``
2024-05-09 14:17:49 +00:00
#### Execution without modulefiles
2022-11-04 16:56:24 -05:00
To use Omniperf without the companion modulefile, update your ` PATH`
settings to enable access to the command-line binary. If you installed Python
dependencies in a shared location, update your ` PYTHONPATH` config as well:
2024-01-31 16:05:12 -06:00
` ``shell-session
2022-11-04 16:56:24 -05:00
export PATH=$INSTALL_DIR/{__VERSION__}/bin:$PATH
export PYTHONPATH=$INSTALL_DIR/python-libs
` ``
2024-05-09 14:17:49 +00:00
#### rocProf
2022-11-04 16:56:24 -05:00
2024-01-31 16:05:12 -06:00
Omniperf relies on a rocProf binary during the profiling
2022-11-04 16:56:24 -05:00
process. Normally the path to this binary will be detected
2023-06-06 11:01:37 -04:00
automatically, but it can also be overridden via the setting the
optional ` ROCPROF` environment variable to the path of the binary the user
wishes to use instead.
2022-11-04 16:56:24 -05:00
2022-11-04 14:49:36 -05:00
%%% ### Generate Packaging
%%% ` ``console
%%% cd build
%%% cpack -G STGZ
%%% cpack -G DEB -D CPACK_PACKAGING_INSTALL_PREFIX=/opt/omniperf
%%% cpack -G RPM -D CPACK_PACKAGING_INSTALL_PREFIX=/opt/omniperf
%%% ` ``
---
2024-05-09 14:17:49 +00:00
### Server-side Setup
2022-11-04 14:49:36 -05:00
2024-03-27 15:42:04 -05:00
` ``{note}
2024-04-01 12:46:54 -05:00
Server-side setup is **not required** to profile or analyze performance data from the CLI. It is provided as an additional mechanism to import performance data for examination within a detailed [Grafana](https://github.com/grafana/grafana) GUI.
2024-03-27 15:42:04 -05:00
` ``
2023-08-14 12:58:33 -05:00
Omniperf server-side requires the following basic software dependencies prior to usage:
* [Docker Engine](https://docs.docker.com/engine/install/)
2022-11-04 14:49:36 -05:00
2023-08-14 12:58:33 -05:00
The recommended process for enabling the server-side of Omniperf is to use the provided Docker file to build the Grafana and MongoDB instance.
2022-11-04 14:49:36 -05:00
2024-03-26 12:54:51 -05:00
Once you have decided which machine you would like to use to host the Grafana and MongoDB instance, please follow the set-up instructions below.
2023-08-14 12:58:33 -05:00
2024-05-09 14:17:49 +00:00
#### Install MongoDB Utils
2022-11-10 11:55:04 -06:00
Omniperf uses [mongoimport](https://www.mongodb.com/docs/database-tools/mongoimport/) to upload data to Grafana's backend database. Install for Ubuntu 20.04 is as follows:
2023-08-14 12:58:33 -05:00
2025-01-02 13:29:47 -08:00
` ``bash
2022-11-07 17:23:07 -06:00
$ wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2004-x86_64-100.6.1.deb
2022-11-10 11:55:04 -06:00
$ sudo apt install ./mongodb-database-tools-ubuntu2004-x86_64-100.6.1.deb
2022-11-07 16:35:41 -06:00
` ``
2023-06-06 11:01:37 -04:00
> Installation instructions for alternative distributions can be found [here](https://www.mongodb.com/download-center/database-tools/releases/archive)
2024-05-09 14:17:49 +00:00
#### Persistent Storage
2023-06-06 11:01:37 -04:00
2023-08-14 12:58:33 -05:00
The user will also bind MongoDB to a directory on the host OS to create a local backup in case of a crash or reset. In the Docker world, this is known as "creating a persistent volume":
2022-11-07 16:35:41 -06:00
2022-11-04 14:49:36 -05:00
` ``bash
$ sudo mkdir -p /usr/local/persist && cd /usr/local/persist/
$ sudo mkdir -p grafana-storage mongodb
2022-11-07 16:35:41 -06:00
$ sudo docker volume create --driver local --opt type=none --opt device=/usr/local/persist/grafana-storage --opt o=bind grafana-storage
$ sudo docker volume create --driver local --opt type=none --opt device=/usr/local/persist/mongodb --opt o=bind grafana-mongo-db
2022-11-04 14:49:36 -05:00
` ``
2024-05-09 14:17:49 +00:00
#### Build and Launch
2023-08-14 12:58:33 -05:00
2024-01-31 16:05:12 -06:00
We are now ready to build our Docker file. Navigate to your Omniperf install directory to begin.
2022-11-04 14:49:36 -05:00
` ``bash
2024-05-09 14:17:49 +00:00
$ cd grafana
2022-11-04 14:49:36 -05:00
$ sudo docker-compose build
2022-11-07 16:35:41 -06:00
$ sudo docker-compose up -d
2022-11-04 14:49:36 -05:00
` ``
2024-03-27 15:42:04 -05:00
> TCP ports for Grafana (4000) and MongoDB (27017) in the docker container are mapped to 14000 and 27018, respectively, on the host side.
2022-11-10 11:55:04 -06:00
2024-03-27 15:42:04 -05:00
` ``{tip}
2024-03-26 12:54:51 -05:00
In the event that your Grafana or MongoDB instance crash fatally, you can always restart the server. Just navigate to your install directory and run:
2024-03-27 15:42:04 -05:00
` ``
2024-03-26 12:54:51 -05:00
` ``bash
2024-05-09 14:17:49 +00:00
$ cd grafana
2024-03-26 12:54:51 -05:00
$ sudo docker-compose down
$ sudo docker-compose up -d
` ``
2024-05-09 14:17:49 +00:00
#### Setup Grafana Instance
2024-01-31 16:05:12 -06:00
Once you have launched your docker container you should be able to reach Grafana at **http://\<host-ip>:14000**. The default login credentials for the first-time Grafana setup are:
2022-11-10 11:55:04 -06:00
- Username: **admin**
- Password: **admin**

2024-05-09 14:17:49 +00:00
#### MongoDB Datasource Configuration
2022-11-10 11:55:04 -06:00
2023-08-14 12:58:33 -05:00
The MongoDB Datasource must be configured prior to the first-time use. Navigate to Grafana's Configuration page (shown below) to add the **Omniperf Data** connection.
2022-11-10 11:55:04 -06:00
2023-08-14 12:58:33 -05:00

2022-11-10 11:55:04 -06:00
2023-08-14 12:58:33 -05:00
Configure the following fields in the datasource settings:
2022-11-10 11:55:04 -06:00
2024-03-27 15:42:04 -05:00
- __HTTP URL__: set to ` http://localhost:3333`
- __MongoDB URL__: set to ` mongodb://temp:temp123@\<host-ip>:27018/admin?authSource=admin`
- __Database Name__: set to ` admin`
2022-11-10 11:55:04 -06:00
2023-08-14 12:58:33 -05:00
After properly configuring these fields click **Save & Test** (as shown below) to make sure your connection is successful.
2022-11-10 11:55:04 -06:00
> Note to avoid potential DNS issue, one may need to use the actual IP address for the host node in the MongoDB URL.
2023-08-14 12:58:33 -05:00

2022-11-10 11:55:04 -06:00
2024-05-09 14:17:49 +00:00
#### Omniperf Dashboard Import
2022-11-10 11:55:04 -06:00
2023-08-14 12:58:33 -05:00
From *Create* → *Import*, (as shown below) upload the dashboard file, ` /dashboards/Omniperf_v{__VERSION__}_pub.json`, from the Omniperf tarball.
2022-11-10 11:55:04 -06:00
Edit both the Dashboard Name and the Unique Identifier (UID) to uniquely identify the dashboard he/she will use. Click Import to finish the process.
2023-08-14 12:58:33 -05:00

2024-05-09 14:17:49 +00:00
#### Using your dashboard
2023-08-14 12:58:33 -05:00
2024-01-31 16:05:12 -06:00
Once you have imported a dashboard you are ready to begin! Start by browsing available dashboards and selecting the dashboard you have just imported.
2023-08-14 12:58:33 -05:00

2024-03-26 12:54:51 -05:00
Remember, you will need to upload workload data to the DB backend before analyzing in your Grafana interface. We provide a detailed example of this in our [Analysis section ](./analysis.md#grafana-gui-import ).
2023-08-14 12:58:33 -05:00
After a workload has been successfully uploaded, you should be able to select it from the workload dropdown located at the top of your Grafana dashboard.

2024-01-31 16:05:12 -06:00
For more information on how to use the Grafana interface for analysis please see the [Grafana section ](./analysis.md#grafana-based-gui ) in the Analyze Mode tab.