GPU: detect GPU index (#1267)

This commit is contained in:
michela feng
2024-09-19 15:22:09 +08:00
committed by GitHub
parent f80423607d
commit 9332f42889
15 changed files with 46 additions and 2 deletions
+2
View File
@@ -295,6 +295,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
ffStrbufInit(&gpu->name);
ffStrbufInit(&gpu->driver);
ffStrbufInit(&gpu->platformApi);
gpu->index = FF_GPU_INDEX_UNSET;
gpu->temperature = FF_GPU_TEMP_UNSET;
gpu->coreUsage = FF_GPU_CORE_USAGE_UNSET;
gpu->coreCount = FF_GPU_CORE_COUNT_UNSET;
@@ -366,6 +367,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
.func = pciFunc,
},
}, (FFGpuDriverResult) {
.index = &gpu->index,
.temp = options->temp ? &gpu->temperature : NULL,
.memory = options->driverSpecific ? &gpu->dedicated : NULL,
.coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL,