GpuStatus QML Type
Provides information on the GPU status. More...
Import Statement: | import QtApplicationManager 2.0 |
Properties
Methods
- update()
Detailed Description
GpuStatus provides information on the status of the GPU. Its property values are updated whenever the method update() is called.
You can use it alongside a Timer for instance to periodically query the status of the GPU:
import QtQuick import QtApplicationManager ... GpuStatus { id: gpuStatus } Timer { interval: 500 running: true repeat: true onTriggered: gpuStatus.update() } Text { property string loadPercent: Number(gpuStatus.gpuLoad * 100).toLocaleString(Qt.locale("en_US"), 'f', 1) text: "GPU load: " + loadPercent + "%" }
You can also use this component as a MonitorModel data source if you want to plot its previous values over time:
import QtQuick import QtApplicationManager ... MonitorModel { GpuStatus {} }
Property Documentation
gpuLoad : real |
GPU utilization when update() was last called, as a value ranging from 0 (inclusive, completely idle) to 1 (inclusive, fully busy).
Note: This is dependent on tools from the graphics hardware vendor and might not work on every system.
Currently, this only works on Linux with either Intel or NVIDIA chipsets, plus the tools from the respective vendors have to be installed:
Hardware | Tool | Notes |
---|---|---|
NVIDIA | nvidia-smi | The utilization will only be shown for the first GPU of the system, in case multiple GPUs are installed. |
Intel | intel_gpu_top | The binary has to be made set-UID root, e.g. via sudo chmod +s $(which intel_gpu_top) , or the application manager has to be run as the root user. |
See also update.
Names of the roles provided by GpuStatus when used as a MonitorModel data source.
See also MonitorModel.
Method Documentation
© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.