From 19590003e101263ec1baddc31fea47ce59f7143c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 28 Jun 2024 22:17:37 +0800 Subject: [PATCH] GPU: guard GPU frequency behind `driverSpecific` --- src/detection/gpu/gpu_linux.c | 2 +- src/detection/gpu/gpu_windows.c | 2 +- src/detection/gpu/gpu_wsl.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/detection/gpu/gpu_linux.c b/src/detection/gpu/gpu_linux.c index 28b33f38c..3a4ecf3d6 100644 --- a/src/detection/gpu/gpu_linux.c +++ b/src/detection/gpu/gpu_linux.c @@ -273,7 +273,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf .memory = options->driverSpecific ? &gpu->dedicated : NULL, .coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL, .type = &gpu->type, - .frequency = &gpu->frequency, + .frequency = options->driverSpecific ? &gpu->frequency : NULL, }, "libnvidia-ml.so"); } diff --git a/src/detection/gpu/gpu_windows.c b/src/detection/gpu/gpu_windows.c index 261d0e82a..34ecaa537 100644 --- a/src/detection/gpu/gpu_windows.c +++ b/src/detection/gpu/gpu_windows.c @@ -162,7 +162,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* .memory = options->driverSpecific ? &gpu->dedicated : NULL, .coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL, .type = &gpu->type, - .frequency = &gpu->frequency, + .frequency = options->driverSpecific ? &gpu->frequency : NULL, }, dllName ); diff --git a/src/detection/gpu/gpu_wsl.cpp b/src/detection/gpu/gpu_wsl.cpp index e4ef8e4ff..0b9c440d0 100644 --- a/src/detection/gpu/gpu_wsl.cpp +++ b/src/detection/gpu/gpu_wsl.cpp @@ -120,7 +120,7 @@ const char* ffGPUDetectByDirectX(FF_MAYBE_UNUSED const FFGPUOptions* options, FF .memory = options->driverSpecific ? &gpu->dedicated : NULL, .coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL, .type = &gpu->type, - .frequency = &gpu->frequency, + .frequency = options->driverSpecific ? &gpu->frequency : NULL, }, "/usr/lib/wsl/lib/libnvidia-ml.so"); } }