SystemMonitor: remove GPU temp
This commit is contained in:
parent
7247a26586
commit
c9285d8c5b
4 changed files with 0 additions and 174 deletions
|
|
@ -40,8 +40,6 @@ RowLayout {
|
||||||
!== undefined) ? widgetSettings.showNetworkStats : widgetMetadata.showNetworkStats
|
!== undefined) ? widgetSettings.showNetworkStats : widgetMetadata.showNetworkStats
|
||||||
readonly property bool showDiskUsage: (widgetSettings.showDiskUsage
|
readonly property bool showDiskUsage: (widgetSettings.showDiskUsage
|
||||||
!== undefined) ? widgetSettings.showDiskUsage : widgetMetadata.showDiskUsage
|
!== undefined) ? widgetSettings.showDiskUsage : widgetMetadata.showDiskUsage
|
||||||
readonly property bool showGpuTemp: (widgetSettings.showGpuTemp !== undefined) ? widgetSettings.showGpuTemp : (widgetMetadata.showGpuTemp
|
|
||||||
|| false)
|
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
spacing: Style.marginS * scaling
|
spacing: Style.marginS * scaling
|
||||||
|
|
@ -121,36 +119,6 @@ RowLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GPU Temperature Component
|
|
||||||
Item {
|
|
||||||
Layout.preferredWidth: gpuTempRow.implicitWidth
|
|
||||||
Layout.preferredHeight: Math.round(Style.capsuleHeight * scaling)
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
visible: showGpuTemp
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: gpuTempRow
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Style.marginXS * scaling
|
|
||||||
|
|
||||||
NIcon {
|
|
||||||
icon: "gpu-temperature"
|
|
||||||
font.pointSize: Style.fontSizeS * scaling
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
NText {
|
|
||||||
text: `${SystemStatService.gpuTemp}°C`
|
|
||||||
font.family: Settings.data.ui.fontFixed
|
|
||||||
font.pointSize: Style.fontSizeXS * scaling
|
|
||||||
font.weight: Style.fontWeightMedium
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
color: Color.mPrimary
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Memory Usage Component
|
// Memory Usage Component
|
||||||
Item {
|
Item {
|
||||||
Layout.preferredWidth: memoryUsageRow.implicitWidth
|
Layout.preferredWidth: memoryUsageRow.implicitWidth
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,6 @@ ColumnLayout {
|
||||||
// Local, editable state for checkboxes
|
// Local, editable state for checkboxes
|
||||||
property bool valueShowCpuUsage: widgetData.showCpuUsage !== undefined ? widgetData.showCpuUsage : widgetMetadata.showCpuUsage
|
property bool valueShowCpuUsage: widgetData.showCpuUsage !== undefined ? widgetData.showCpuUsage : widgetMetadata.showCpuUsage
|
||||||
property bool valueShowCpuTemp: widgetData.showCpuTemp !== undefined ? widgetData.showCpuTemp : widgetMetadata.showCpuTemp
|
property bool valueShowCpuTemp: widgetData.showCpuTemp !== undefined ? widgetData.showCpuTemp : widgetMetadata.showCpuTemp
|
||||||
property bool valueShowGpuTemp: widgetData.showGpuTemp !== undefined ? widgetData.showGpuTemp : (widgetMetadata.showGpuTemp
|
|
||||||
|| false)
|
|
||||||
property bool valueShowMemoryUsage: widgetData.showMemoryUsage !== undefined ? widgetData.showMemoryUsage : widgetMetadata.showMemoryUsage
|
property bool valueShowMemoryUsage: widgetData.showMemoryUsage !== undefined ? widgetData.showMemoryUsage : widgetMetadata.showMemoryUsage
|
||||||
property bool valueShowMemoryAsPercent: widgetData.showMemoryAsPercent
|
property bool valueShowMemoryAsPercent: widgetData.showMemoryAsPercent
|
||||||
!== undefined ? widgetData.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent
|
!== undefined ? widgetData.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent
|
||||||
|
|
@ -29,7 +27,6 @@ ColumnLayout {
|
||||||
var settings = Object.assign({}, widgetData || {})
|
var settings = Object.assign({}, widgetData || {})
|
||||||
settings.showCpuUsage = valueShowCpuUsage
|
settings.showCpuUsage = valueShowCpuUsage
|
||||||
settings.showCpuTemp = valueShowCpuTemp
|
settings.showCpuTemp = valueShowCpuTemp
|
||||||
settings.showGpuTemp = valueShowGpuTemp
|
|
||||||
settings.showMemoryUsage = valueShowMemoryUsage
|
settings.showMemoryUsage = valueShowMemoryUsage
|
||||||
settings.showMemoryAsPercent = valueShowMemoryAsPercent
|
settings.showMemoryAsPercent = valueShowMemoryAsPercent
|
||||||
settings.showNetworkStats = valueShowNetworkStats
|
settings.showNetworkStats = valueShowNetworkStats
|
||||||
|
|
@ -53,14 +50,6 @@ ColumnLayout {
|
||||||
onToggled: checked => valueShowCpuTemp = checked
|
onToggled: checked => valueShowCpuTemp = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
NToggle {
|
|
||||||
id: showGpuTemp
|
|
||||||
Layout.fillWidth: true
|
|
||||||
label: "GPU temperature"
|
|
||||||
checked: valueShowGpuTemp
|
|
||||||
onToggled: checked => valueShowGpuTemp = checked
|
|
||||||
}
|
|
||||||
|
|
||||||
NToggle {
|
NToggle {
|
||||||
id: showMemoryUsage
|
id: showMemoryUsage
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,6 @@ Singleton {
|
||||||
"allowUserSettings": true,
|
"allowUserSettings": true,
|
||||||
"showCpuUsage": true,
|
"showCpuUsage": true,
|
||||||
"showCpuTemp": true,
|
"showCpuTemp": true,
|
||||||
"showGpuTemp": false,
|
|
||||||
"showMemoryUsage": true,
|
"showMemoryUsage": true,
|
||||||
"showMemoryAsPercent": false,
|
"showMemoryAsPercent": false,
|
||||||
"showNetworkStats": false,
|
"showNetworkStats": false,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ Singleton {
|
||||||
// Public values
|
// Public values
|
||||||
property real cpuUsage: 0
|
property real cpuUsage: 0
|
||||||
property real cpuTemp: 0
|
property real cpuTemp: 0
|
||||||
property real gpuTemp: 0
|
|
||||||
property real memGb: 0
|
property real memGb: 0
|
||||||
property real memPercent: 0
|
property real memPercent: 0
|
||||||
property real diskPercent: 0
|
property real diskPercent: 0
|
||||||
|
|
@ -36,12 +35,6 @@ Singleton {
|
||||||
readonly property var supportedTempCpuSensorNames: ["coretemp", "k10temp", "zenpower"]
|
readonly property var supportedTempCpuSensorNames: ["coretemp", "k10temp", "zenpower"]
|
||||||
property string cpuTempSensorName: ""
|
property string cpuTempSensorName: ""
|
||||||
property string cpuTempHwmonPath: ""
|
property string cpuTempHwmonPath: ""
|
||||||
// Gpu temperature (simple hwmon read if available)
|
|
||||||
readonly property var supportedTempGpuSensorNames: ["amdgpu", "nvidia", "radeon"]
|
|
||||||
property string gpuTempSensorName: ""
|
|
||||||
property string gpuTempHwmonPath: ""
|
|
||||||
property bool gpuIsDedicated: false
|
|
||||||
property string _gpuPendingAmdPath: ""
|
|
||||||
// For Intel coretemp averaging of all cores/sensors
|
// For Intel coretemp averaging of all cores/sensors
|
||||||
property var intelTempValues: []
|
property var intelTempValues: []
|
||||||
property int intelTempFilesChecked: 0
|
property int intelTempFilesChecked: 0
|
||||||
|
|
@ -73,7 +66,6 @@ Singleton {
|
||||||
dfProcess.running = true
|
dfProcess.running = true
|
||||||
|
|
||||||
updateCpuTemperature()
|
updateCpuTemperature()
|
||||||
updateGpuTemperature()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -192,108 +184,6 @@ Singleton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------
|
|
||||||
// --------------------------------------------
|
|
||||||
// ---- GPU temperature detection (hwmon)
|
|
||||||
FileView {
|
|
||||||
id: gpuTempNameReader
|
|
||||||
property int currentIndex: 0
|
|
||||||
printErrors: false
|
|
||||||
|
|
||||||
function checkNext() {
|
|
||||||
if (currentIndex >= 16) {
|
|
||||||
// Check up to hwmon10
|
|
||||||
Logger.warn("SystemStat", "No supported GPU temperature sensor found")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
gpuTempNameReader.path = `/sys/class/hwmon/hwmon${currentIndex}/name`
|
|
||||||
gpuTempNameReader.reload()
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: checkNext()
|
|
||||||
|
|
||||||
onLoaded: {
|
|
||||||
const name = text().trim()
|
|
||||||
if (root.supportedTempGpuSensorNames.includes(name)) {
|
|
||||||
const hwPath = `/sys/class/hwmon/hwmon${currentIndex}`
|
|
||||||
if (name === "nvidia") {
|
|
||||||
// Treat NVIDIA as dedicated by default
|
|
||||||
root.gpuTempSensorName = name
|
|
||||||
root.gpuTempHwmonPath = hwPath
|
|
||||||
root.gpuIsDedicated = true
|
|
||||||
Logger.log("SystemStat", `Selected NVIDIA GPU thermal sensor at ${root.gpuTempHwmonPath}`)
|
|
||||||
} else if (name === "amdgpu") {
|
|
||||||
// Probe VRAM to distinguish dGPU vs iGPU
|
|
||||||
root._gpuPendingAmdPath = hwPath
|
|
||||||
vramReader.requestCheck(hwPath)
|
|
||||||
} else if (!root.gpuTempHwmonPath) {
|
|
||||||
// Fallback to first supported sensor (e.g., radeon)
|
|
||||||
root.gpuTempSensorName = name
|
|
||||||
root.gpuTempHwmonPath = hwPath
|
|
||||||
Logger.log("SystemStat", `Selected GPU thermal sensor at ${root.gpuTempHwmonPath}`)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
currentIndex++
|
|
||||||
Qt.callLater(() => {
|
|
||||||
checkNext()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onLoadFailed: function (error) {
|
|
||||||
currentIndex++
|
|
||||||
Qt.callLater(() => {
|
|
||||||
checkNext()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reader to detect AMD dGPU by checking VRAM presence
|
|
||||||
FileView {
|
|
||||||
id: vramReader
|
|
||||||
property string targetHwmonPath: ""
|
|
||||||
function requestCheck(hwPath) {
|
|
||||||
targetHwmonPath = hwPath
|
|
||||||
vramReader.path = `${hwPath}/device/mem_info_vram_total`
|
|
||||||
vramReader.reload()
|
|
||||||
}
|
|
||||||
printErrors: false
|
|
||||||
onLoaded: {
|
|
||||||
const val = parseInt(text().trim())
|
|
||||||
// If VRAM present (>0), prefer this as dGPU
|
|
||||||
if (!isNaN(val) && val > 0) {
|
|
||||||
root.gpuTempSensorName = "amdgpu"
|
|
||||||
root.gpuTempHwmonPath = targetHwmonPath
|
|
||||||
root.gpuIsDedicated = true
|
|
||||||
Logger.log("SystemStat",
|
|
||||||
`Selected AMD dGPU (VRAM=${Math.round(val / (1024 * 1024 * 1024))}GB) at ${root.gpuTempHwmonPath}`)
|
|
||||||
} else if (!root.gpuTempHwmonPath) {
|
|
||||||
// Use as fallback iGPU if nothing selected yet
|
|
||||||
root.gpuTempSensorName = "amdgpu"
|
|
||||||
root.gpuTempHwmonPath = targetHwmonPath
|
|
||||||
root.gpuIsDedicated = false
|
|
||||||
Logger.log("SystemStat", `Selected AMD GPU (no VRAM) at ${root.gpuTempHwmonPath}`)
|
|
||||||
}
|
|
||||||
// Continue scanning other hwmon entries
|
|
||||||
gpuTempNameReader.currentIndex++
|
|
||||||
Qt.callLater(() => {
|
|
||||||
gpuTempNameReader.checkNext()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
onLoadFailed: function (error) {
|
|
||||||
// If failed to read VRAM, consider as fallback if none selected
|
|
||||||
if (!root.gpuTempHwmonPath) {
|
|
||||||
root.gpuTempSensorName = "amdgpu"
|
|
||||||
root.gpuTempHwmonPath = targetHwmonPath
|
|
||||||
}
|
|
||||||
gpuTempNameReader.currentIndex++
|
|
||||||
Qt.callLater(() => {
|
|
||||||
gpuTempNameReader.checkNext()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------------------
|
// -------------------------------------------------------
|
||||||
// -------------------------------------------------------
|
// -------------------------------------------------------
|
||||||
// Parse memory info from /proc/meminfo
|
// Parse memory info from /proc/meminfo
|
||||||
|
|
@ -459,26 +349,6 @@ Singleton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------
|
|
||||||
// Function to start/refresh the GPU temperature
|
|
||||||
function updateGpuTemperature() {
|
|
||||||
if (!root.gpuTempHwmonPath)
|
|
||||||
return
|
|
||||||
gpuTempReader.path = `${root.gpuTempHwmonPath}/temp1_input`
|
|
||||||
gpuTempReader.reload()
|
|
||||||
}
|
|
||||||
|
|
||||||
FileView {
|
|
||||||
id: gpuTempReader
|
|
||||||
printErrors: false
|
|
||||||
onLoaded: {
|
|
||||||
const data = parseInt(text().trim())
|
|
||||||
if (!isNaN(data)) {
|
|
||||||
root.gpuTemp = Math.round(data / 1000.0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------------------
|
// -------------------------------------------------------
|
||||||
// Function to check next Intel temperature sensor
|
// Function to check next Intel temperature sensor
|
||||||
function checkNextIntelTemp() {
|
function checkNextIntelTemp() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue