From 745c041b441bfadf4781d02f90a1a7d67d8983eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 26 Sep 2024 23:53:13 +0800 Subject: [PATCH] GPU (Linux): fix some obvious bugs found in #1284 --- src/detection/gpu/gpu_linux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/detection/gpu/gpu_linux.c b/src/detection/gpu/gpu_linux.c index 0db1373a7..6472f36a2 100644 --- a/src/detection/gpu/gpu_linux.c +++ b/src/detection/gpu/gpu_linux.c @@ -99,7 +99,7 @@ static const char* drmDetectAmdSpecific(const FFGPUOptions* options, FFGPUResult if (options->temp) { if (ffamdgpu_query_sensor_info(handle, AMDGPU_INFO_SENSOR_GPU_TEMP, sizeof(value), &value) >= 0) - gpu->temperature = value; + gpu->temperature = value / 1000.; } ffStrbufSetS(&gpu->name, ffamdgpu_get_marketing_name(handle)); @@ -107,9 +107,9 @@ static const char* drmDetectAmdSpecific(const FFGPUOptions* options, FFGPUResult struct amdgpu_gpu_info gpuInfo; if (ffamdgpu_query_gpu_info(handle, &gpuInfo) >= 0) { - gpu->coreCount = (int32_t) gpuInfo.num_shader_engines; + gpu->coreCount = (int32_t) gpuInfo.cu_active_number; gpu->frequency = (uint32_t) (gpuInfo.max_engine_clk / 1000u); - gpu->index = gpuInfo.asic_id; + gpu->index = FF_GPU_INDEX_UNSET; gpu->type = gpuInfo.ids_flags & AMDGPU_IDS_FLAGS_FUSION ? FF_GPU_TYPE_INTEGRATED : FF_GPU_TYPE_DISCRETE; struct amdgpu_heap_info heapInfo;