Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ add_subdirectory(ovmerge)
add_subdirectory(pinctrl)
add_subdirectory(piolib)
add_subdirectory(raspinfo)
add_subdirectory(rpi-gpu-usage)
add_subdirectory(rpieepromab)
add_subdirectory(vcgencmd)
add_subdirectory(vclog)
Expand Down
14 changes: 14 additions & 0 deletions rpi-gpu-usage/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.10...3.27)

include(GNUInstallDirs)

project(rpi-gpu-usage)

find_package(Curses REQUIRED)

add_executable(rpi-gpu-usage rpi-gpu-usage.c)
target_include_directories(rpi-gpu-usage PRIVATE ${CURSES_INCLUDE_DIRS})
target_link_libraries(rpi-gpu-usage ${CURSES_LIBRARIES})
install(TARGETS rpi-gpu-usage RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES rpi-gpu-usage.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
install(FILES rpi-gpu-usage-completion.bash RENAME rpi-gpu-usage DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/bash-completion/completions")
7 changes: 7 additions & 0 deletions rpi-gpu-usage/rpi-gpu-usage-completion.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
_rpi_gpu_usage() {
local cur prev words cword
_init_completion || return
COMPREPLY=($(compgen -W "--csv --help" -- "$cur"))
}

complete -F _rpi_gpu_usage rpi-gpu-usage
29 changes: 29 additions & 0 deletions rpi-gpu-usage/rpi-gpu-usage.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.TH RPI-GPU-USAGE 1 "2025" "raspi-utils" "Raspberry Pi Utilities"
.SH NAME
rpi-gpu-usage \- monitor VideoCore GPU block utilisation
.SH SYNOPSIS
.B rpi-gpu-usage
.RI [ options ]
.SH DESCRIPTION
.B rpi-gpu-usage
monitors the VideoCore GPU block utilisation on Raspberry Pi 4/5.
It reads per-process GPU engine times from DRM fdinfo and global
utilisation from the V3D gpu_stats sysfs interface.
.PP
The display is refreshed once per second, showing per-client
GPU engine usage (render, tfu, bin) and CPU usage.
.SH OPTIONS
.TP
.B \-\-csv
Output in CSV format instead of a formatted table.
Suitable for piping to a file for later analysis.
.TP
.B \-\-help
Show usage information and exit.
.SH EXAMPLES
.nf
sudo rpi-gpu-usage # interactive terminal display
sudo rpi-gpu-usage --csv > gpu.csv # log CSV to file
.fi
.SH SEE ALSO
.BR vcgencmd (1)
Loading