mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
GPU: huge improvement of driver specific detection code
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
extern "C" {
|
||||
#include "common/library.h"
|
||||
#include "detection/gpu/gpu.h"
|
||||
#include "detection/gpu/gpu_nvidia.h"
|
||||
#include "detection/gpu/gpu_driver_specific.h"
|
||||
}
|
||||
|
||||
#include <wsl/winadapter.h>
|
||||
@@ -65,6 +65,7 @@ const char* ffGPUDetectByDirectX(FF_MAYBE_UNUSED const FFGPUOptions* options, FF
|
||||
ffStrbufInitS(&gpu->name, desc);
|
||||
gpu->coreCount = FF_GPU_CORE_COUNT_UNSET;
|
||||
gpu->temperature = FF_GPU_TEMP_UNSET;
|
||||
gpu->frequency = FF_GPU_FREQUENCY_UNSET;
|
||||
|
||||
ffStrbufInit(&gpu->driver);
|
||||
uint64_t value = 0;
|
||||
@@ -97,14 +98,20 @@ const char* ffGPUDetectByDirectX(FF_MAYBE_UNUSED const FFGPUOptions* options, FF
|
||||
|
||||
if (vendorStr == FF_GPU_VENDOR_NAME_NVIDIA && options->useNvml)
|
||||
{
|
||||
ffDetectNvidiaGpuInfo((FFGpuNvidiaCondition) {
|
||||
.pciBusId = nullptr,
|
||||
.pciDeviceId = (hardwareId.deviceID << 16) | hardwareId.vendorID,
|
||||
.pciSubSystemId = hardwareId.subSysID
|
||||
ffDetectNvidiaGpuInfo(&(FFGpuDriverCondition) {
|
||||
.type = FF_GPU_DRIVER_CONDITION_TYPE_DEVICE_ID,
|
||||
.pciDeviceId = {
|
||||
.deviceId = hardwareId.deviceID,
|
||||
.vendorId = hardwareId.vendorID,
|
||||
.subSystemId = hardwareId.subSysID,
|
||||
.revId = hardwareId.revision,
|
||||
},
|
||||
}, (FFGpuNvidiaResult) {
|
||||
.temp = options->temp ? &gpu->temperature : NULL,
|
||||
.memory = options->useNvml ? &gpu->dedicated : NULL,
|
||||
.coreCount = options->useNvml ? (uint32_t*) &gpu->coreCount : NULL,
|
||||
.type = options->useNvml ? (uint32_t*) &gpu->type : NULL,
|
||||
.frequency = options->useNvml ? &gpu->frequency : NULL,
|
||||
}, "/usr/lib/wsl/lib/libnvidia-ml.so");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user