vcgencmd - Raspberry Pi GPU Firmware CLI
约 2 分钟阅读
vcgencmd
vcgencmd is a command-line tool for the Raspberry Pi that allows you to query the GPU firmware for various system and hardware information.
Installation
# Alpine Linux
apk add raspberrypi-utils-vcgencmdCommon Commands
System Information & Health
vcgencmd version # Show firmware version
vcgencmd measure_temp # Show GPU temperature
vcgencmd get_throttled # Check for under-voltage or overheating issues (see breakdown below)
vcgencmd measure_clock arm # Show ARM (CPU) clock frequency in Hz
vcgencmd measure_volts core # Show core voltageMemory & Display
vcgencmd get_mem arm # Show memory allocated to ARM (CPU) in MB
vcgencmd get_mem gpu # Show memory allocated to GPU in MB
vcgencmd display_power 1 # Turn display power ON
vcgencmd display_power 0 # Turn display power OFFCodecs & Hardware Acceleration
vcgencmd codec_enabled H264 # Check if H264 hardware codec is enabled
vcgencmd codec_enabled MJPEG # Check if MJPEG hardware codec is enabledget_throttled Bitmask Breakdown
The value returned by vcgencmd get_throttled is a bitmask where each bit represents a specific state.
| Bit | Hex Value | Description |
|---|---|---|
| 0 | 0x1 | Under-voltage detected (Lightning bolt icon). |
| 1 | 0x2 | ARM frequency capped (Frequency limited). |
| 2 | 0x4 | Currently throttled. |
| 3 | 0x8 | Soft temperature limit active. |
| 16 | 0x10000 | Under-voltage has occurred since last reboot. |
| 17 | 0x20000 | ARM frequency capped has occurred since last reboot. |
| 18 | 0x40000 | Throttling has occurred since last reboot. |
| 19 | 0x80000 | Soft temperature limit has occurred since last reboot. |
- 低 4 位是当前状态,16–19 位是启动后发生过;
throttled=0x0表示正常 - 常见值
0x50000- 曾欠压并降频,当前正常;多为电源或线材不足0x50005- 当前正在欠压并降频0x80008- 曾达到并仍处于软温度限制,检查散热0xe0000- 曾发生降频、频率封顶和软温度限制,但未欠压;通常是温度问题
# 解析 get_throttled 位
v=$(( $(vcgencmd get_throttled | cut -d= -f2) ))
for b in 0:under-voltage 1:freq-capped 2:throttled 3:soft-temp-limit \
16:under-voltage-occurred 17:freq-capped-occurred 18:throttled-occurred 19:soft-temp-limit-occurred; do
if (( v >> ${b%%:*} & 1 )); then echo "${b#*:}"; fi
doneRaw Output Examples
vcgencmd measure_volts Options
volt=0.8563V (core)
volt=1.1000V (sdram_c)
volt=1.1000V (sdram_i)
volt=1.1000V (sdram_p)vcgencmd get_config int (Abbreviated)
arm_64bit=1
arm_freq=1500
core_freq=500
total_mem=1024Resources
关联信息
反向链接、本文链接的其他页面和外部资料。
反向链接
- Raspberry Pi (树莓派) Overview & Getting Started笔记 · Diagnostics (vcgencmd)
The Raspberry Pi is a versatile series of single-board computers (SBCs) used for everything from learning basic programming to deploying high-performance edge computing nodes.
- Raspberry Pi FAQ & Troubleshooting (常见问题)笔记 · vcgencmd Guide
A collection of common issues, error messages, and solutions for Raspberry Pi hardware and software. · This indicates your power supply is dropping below 4.63V.
参考资料
GitHub1 条
- raspberrypi/userlandgithub.com/raspberrypi/userland
其他外链2 条
- elinux.org/RPI_vcgencmd_usageelinux.org/RPI_vcgencmd_usage
- www.raspberrypi.com/documentation/computers/os.htmlwww.raspberrypi.com/documentation/computers/os.html