Standalone Debian package installation#
For SR-IOV/GIM hypervisor hosts, see SR-IOV Debian package installation instead.
System requirements#
Before you install AMD Device Metrics Exporter, install the AMD GPU driver (amdgpu) from the Radeon repository.
Make sure that your system meets the following requirements:
Operating System: Ubuntu 22.04 or Ubuntu 24.04
ROCm / AMDGPU Driver: ROCm 6.2.0 or later (includes the compatible AMDGPU driver)
Installation#
Step 1: Install system prerequisites#
Install Linux headers and modules:
sudo apt update sudo apt install "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)"
Add user to required groups:
sudo usermod -a -G render,video $LOGNAME
Step 2: Install the AMD GPU driver#
Note
For the latest information about installing the DKMS driver, see the ROCm installation quick start.
Download the driver from the Radeon repository (repo.radeon.com) for your operating system. For example, to install ROCm 7.2.3 on Ubuntu 22.04:
wget https://repo.radeon.com/amdgpu-install/7.2.3/ubuntu/jammy/amdgpu-install_7.2.3.70203-1_all.deb sudo apt install ./amdgpu-install_7.2.3.70203-1_all.deb sudo apt update
For other ROCm versions, browse repo.radeon.com/amdgpu-install to find the correct
.debfor your OS.Install the driver:
sudo apt install amdgpu-dkms sudo reboot
Load the driver module:
sudo modprobe amdgpu
Step 3: Install the APT prerequisites for the exporter#
Update the package list and install necessary tools, keyrings and keys:
# Install necessary tools sudo apt update sudo apt install vim wget gpg # Create the keyrings directory with the appropriate permissions: sudo mkdir --parents --mode=0755 /etc/apt/keyrings # Download the ROCm GPG key and add it to the keyrings: wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null
Add the Device Metrics Exporter repository to the APT sources:
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/device-metrics-exporter/apt/1.5.5 jammy main" \ | sudo tee /etc/apt/sources.list.d/device-metrics-exporter.list
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/device-metrics-exporter/apt/1.5.5 noble main" \ | sudo tee /etc/apt/sources.list.d/device-metrics-exporter.list
Update the package list again:
sudo apt update
Step 4: Install the exporter#
Install the Device Metrics Exporter:
sudo apt install amdgpu-exporter
Enable and start services:
sudo systemctl enable amd-metrics-exporter.service sudo systemctl start amd-metrics-exporter.service
Check service status:
sudo systemctl status amd-metrics-exporter.service
Note
Stop the services before you unload or upgrade the GPU driver or change GPU partitions. See Service management for driver and partition operations.
Default settings#
Metrics endpoint:
http://localhost:5000/metricsConfiguration file:
/etc/metrics/config.jsonGPU Agent socket:
/var/run/gpuagent.sock(Unix Domain Socket)
To change the HTTP port, set the ServerPort field in the configuration file.
Custom configuration#
Using a different configuration file#
The exporter reads /etc/metrics/config.json by default. To use a configuration file at a different path:
Edit the
amd-metrics-exporterservice file:sudo vi /lib/systemd/system/amd-metrics-exporter.service
Update the
ExecStartline to point to your configuration file:ExecStart=/usr/local/bin/amd-metrics-exporter -amd-metrics-config /path/to/config.json
Reload systemd and restart the exporter:
sudo systemctl daemon-reload sudo systemctl restart amd-metrics-exporter.service
Changing the GPU Agent socket path (advanced)#
By default, GPU Agent uses the Unix domain socket /var/run/gpuagent.sock for communication with the metrics exporter.
To change the socket path:
Edit the GPU Agent service file:
sudo vi /lib/systemd/system/gpuagent.service
Update
ExecStartwith the custom socket path:ExecStart=/usr/local/bin/gpuagent -s /path/to/custom.sock
Edit the Metrics Exporter service file:
sudo vi /lib/systemd/system/amd-metrics-exporter.service
Update
ExecStartto use the same socket path:ExecStart=/usr/local/bin/amd-metrics-exporter -s /path/to/custom.sock
Reload systemd and restart both services:
sudo systemctl daemon-reload sudo systemctl restart gpuagent.service sudo systemctl restart amd-metrics-exporter.service
Changing the exporter port#
Edit the configuration file:
sudo vi /etc/metrics/config.json
Set
ServerPortto the port you want to use.Restart the exporter service:
sudo systemctl restart amd-metrics-exporter.service
Stopping the exporter#
To stop the exporter and GPU Agent services, run:
sudo systemctl stop amd-metrics-exporter.service
sudo systemctl stop gpuagent.service
Confirming the exporter is running#
To confirm that the exporter and GPU Agent services are running, run:
systemctl status amd-metrics-exporter.service
systemctl status gpuagent.service
To confirm that the metrics endpoint responds, run:
curl http://localhost:5000/metrics
Service management for driver and partition operations#
The exporter and GPU Agent services must be stopped before performing the following operations:
GPU driver unload or upgrade
GPU partition configuration changes
Required Steps:
Stop both services. See Stopping the exporter.
Upgrade the driver or change the partitions.
Start both services with the enable and start commands from Step 4: Install the exporter.
Verify that both services are running. See Confirming the exporter is running.
Removing the exporter and other components#
To remove the exporter and, optionally, the components it depends on:
Uninstall the Metrics Exporter:
Remove the package and its configuration files:
sudo apt purge amdgpu-exporter
(Optional) Uninstall the AMD GPU driver:
Remove the DKMS driver package and the
amdgpu-installrepository package:sudo apt purge amdgpu-dkms amdgpu-install sudo apt autoremove
Unload the driver module:
sudo modprobe -r amdgpu
(Optional) Remove the system prerequisites:
Remove Linux header and module packages:
sudo apt remove linux-headers-$(uname -r) sudo apt remove linux-modules-extra-$(uname -r)
Remove the user from groups:
sudo gpasswd -d $LOGNAME render sudo gpasswd -d $LOGNAME video