How to Use the Command 'radeontop' (with Examples)
- Linux
- December 17, 2024
‘radeontop’ is a command-line utility designed to monitor the utilization of AMD GPUs on a system. It provides insight into how different components of the GPU are being utilized, such as the graphics pipe, memory controller, and more. This data can be crucial for developers, gamers, or anyone interested in understanding the performance or identifying bottlenecks of their GPU. The utility may require root privileges on some systems to access detailed GPU utilization data.
Use Case 1: Show the Utilization of the Default AMD GPU
Code:
radeontop
Motivation: Monitoring the GPU utilization is essential for performance tuning and troubleshooting. By running ‘radeontop’ without any additional arguments, users can quickly view the current utilization of their default AMD GPU. This base usage provides a broad overview of GPU activity and can help diagnose whether high GPU load is affecting system performance.
Explanation: The command ‘radeontop’ is executed with no additional arguments, which by default launches the utility to monitor the primary or default AMD GPU in the system. This command offers a snapshot of the GPU’s current performance metrics, displaying utilization data such as activity levels across different systems like the graphics pipe and memory. No specific bus or visual modifications are defined here, providing a straightforward, unfiltered view.
Example Output:
BUS 0 Name: gpu0
%
Grp 90 Grb 0 Grs 0 Gwt 90 Gws 0 Gsu 0 Gcy 0
...
GRS indicates Graphics, and other streams of utilization are graphs based on usage latency.
Use Case 2: Enable Colored Output
Code:
radeontop --color
Motivation: Utilizing color in output can significantly improve readability, especially in a data-rich display like GPU utilization. For users who frequently monitor these statistics, colored output helps to quickly identify critical metrics, trends, and potential issues based on color-coded data, thereby enhancing clarity and speed when analyzing the information.
Explanation: By adding the --color
flag, ‘radeontop’ will render its output with colors, highlighting different aspects of GPU usage. Different color associations allow users to visually distinguish among various GPU parameters, making the output easier to parse, especially when changes occur rapidly or when specific thresholds are met or exceeded.
Example Output:
BUS 0 Name: gpu0
%
Grp 90 Grb 0 Grs 0 Gwt 90 Gws 0 Gsu 0 Gcy 0
[Colored markings indicate different activity levels]
Use Case 3: Select a Specific GPU
Code:
radeontop --bus bus_number
Motivation: In systems equipped with multiple GPUs, such as gaming rigs or professional workstations, it is crucial to monitor individual GPUs to acquire distinct performance insights. By selecting a specific GPU using its bus number, users can focus on analyzing the utilization of that particular GPU, which is especially valuable for debugging multi-GPU setups, development tasks, or workload balancing.
Explanation: The --bus bus_number
argument specifies the particular GPU based on its bus number obtained from the lspci
command. GPU bus numbers are akin to addresses that allow the system to identify and execute commands on the correct hardware. This option targets a specific GPU for individualized monitoring, ensuring that users are inspecting the desired device amidst multiple GPUs.
Example Output:
BUS 1 Name: gpu1
%
Grp 45 Grb 5 Grs 10 Gwt 45 Gws 5 Gsu 0 Gcy 0
[This output represents utilization statistics for the second GPU]
Use Case 4: Specify the Display Refresh Rate
Code:
radeontop --ticks samples_per_second
Motivation: This use case is particularly helpful for those who need real-time data with varying granularity. Controlling the display refresh rate allows users to adjust how often the data is sampled and presented, balancing between detailed observation (high sampling) and reduced system load (lower sampling). This flexibility is essential when working under different performance constraints or when higher temporal resolution is required for detailed analysis.
Explanation: The --ticks samples_per_second
option allows users to define the rate at which ‘radeontop’ samples GPU usage data. By setting the ‘samples_per_second’, users manage the refresh rate of the displayed statistics, choosing how frequently data updates occur. A higher setting results in more frequent updates—which might increase GPU overhead—while a lower setting decreases refresh rates, conserving resources but providing less real-time data.
Example Output:
BUS 0 Name: gpu0
%
Grp 88 Grb 12 Grs 5 Gwt 82 Gws 7 Gsu 2 Gcy 1
[The utilization statistics refresh at the user-defined rate]
Conclusion:
‘radeontop’ serves as a powerful tool for monitoring AMD GPU utilization, offering multiple options to cater to diverse user requirements. Whether you’re seeking to evaluate all GPUs or focus on specific parameters with enhanced readability, ‘radeontop’ ensures you have the insights you need, presented in a performant and user-friendly manner.