GpuStatus QML Type

Provides information on the GPU status. More...

Import Statement: import QtApplicationManager 2.0

Properties

Methods

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 2.11
import QtApplicationManager 2.0
...
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 2.11
import QtApplicationManager 2.0
...
MonitorModel {
    GpuStatus {}
}

Property Documentation

[read-only] 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:

HardwareToolNotes
NVIDIAnvidia-smiThe utilization will only be shown for the first GPU of the system, in case multiple GPUs are installed.
Intelintel_gpu_topThe 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.


[read-only] roleNames : list<string>

Names of the roles provided by GpuStatus when used as a MonitorModel data source.

See also MonitorModel.


Method Documentation

update()

Updates the gpuLoad property.

See also gpuLoad.


© 2021 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.