From e37ad26729ff795be12d92799870601ad149e3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 22 Jun 2024 21:52:20 +0800 Subject: [PATCH] GPU (Nvidia): fix definition of `nvmlMemory_v2` --- src/detection/gpu/nvml.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/detection/gpu/nvml.h b/src/detection/gpu/nvml.h index 7a2761893..ea776a4be 100644 --- a/src/detection/gpu/nvml.h +++ b/src/detection/gpu/nvml.h @@ -52,7 +52,8 @@ typedef struct { // Allocated device memory (in bytes) unsigned long long used; } nvmlMemory_v2_t; -enum { nvmlMemory_v2 = 2 }; +// https://github.com/NVIDIA/nvidia-settings/issues/78#issuecomment-1012837988 +enum { nvmlMemory_v2 = (unsigned int)(sizeof(nvmlMemory_v2_t) | (2 << 24U)) }; // https://docs.nvidia.com/deploy/nvml-api/group__nvmlDeviceEnumvs.html#group__nvmlDeviceEnumvs_1g805c0647be9996589fc5e3f6ff680c64 // Clock types