diff --git a/src/detection/gpu/gpu.h b/src/detection/gpu/gpu.h index bef90b6d5..a81dd11f1 100644 --- a/src/detection/gpu/gpu.h +++ b/src/detection/gpu/gpu.h @@ -34,6 +34,7 @@ typedef struct FFGPUResult FFstrbuf name; FFstrbuf driver; FFstrbuf platformApi; + FFstrbuf memoryType; double temperature; double coreUsage; int32_t coreCount; diff --git a/src/detection/gpu/gpu_apple.c b/src/detection/gpu/gpu_apple.c index 535b8bc3e..909fc6a5f 100644 --- a/src/detection/gpu/gpu_apple.c +++ b/src/detection/gpu/gpu_apple.c @@ -103,6 +103,7 @@ const char* ffDetectGPUImpl(const FFGPUOptions* options, FFlist* gpus) FFGPUResult* gpu = ffListAdd(gpus); + ffStrbufInit(&gpu->memoryType); gpu->dedicated.total = gpu->dedicated.used = gpu->shared.total = gpu->shared.used = FF_GPU_VMEM_SIZE_UNSET; gpu->type = FF_GPU_TYPE_UNKNOWN; gpu->frequency = FF_GPU_FREQUENCY_UNSET; diff --git a/src/detection/gpu/gpu_bsd.c b/src/detection/gpu/gpu_bsd.c index 1525e9e0e..bd1932dcb 100644 --- a/src/detection/gpu/gpu_bsd.c +++ b/src/detection/gpu/gpu_bsd.c @@ -40,7 +40,8 @@ const char* ffDetectGPUImpl(const FFGPUOptions* options, FFlist* gpus) ffStrbufInitStatic(&gpu->vendor, ffGPUGetVendorString(pc->pc_vendor)); ffStrbufInit(&gpu->name); ffStrbufInitS(&gpu->driver, pc->pd_name); - ffStrbufInit(&gpu->platformApi); + ffStrbufInitStatic(&gpu->platformApi, "/dev/pci"); + ffStrbufInit(&gpu->memoryType); gpu->index = FF_GPU_INDEX_UNSET; gpu->temperature = FF_GPU_TEMP_UNSET; gpu->coreCount = FF_GPU_CORE_COUNT_UNSET; diff --git a/src/detection/gpu/gpu_general.c b/src/detection/gpu/gpu_general.c index 703b0b237..5fa7d3441 100644 --- a/src/detection/gpu/gpu_general.c +++ b/src/detection/gpu/gpu_general.c @@ -33,7 +33,8 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* ffStrbufInitStatic(&gpu->vendor, ffGPUGetVendorString(dev->vendor_id)); ffStrbufInit(&gpu->name); ffStrbufInit(&gpu->driver); - ffStrbufInit(&gpu->platformApi); + ffStrbufInitStatic(&gpu->platformApi, "libpciaccess"); + ffStrbufInit(&gpu->memoryType); gpu->temperature = FF_GPU_TEMP_UNSET; gpu->coreCount = FF_GPU_CORE_COUNT_UNSET; gpu->coreUsage = FF_GPU_CORE_USAGE_UNSET; diff --git a/src/detection/gpu/gpu_haiku.c b/src/detection/gpu/gpu_haiku.c index 16b40c860..ec1e566f8 100644 --- a/src/detection/gpu/gpu_haiku.c +++ b/src/detection/gpu/gpu_haiku.c @@ -23,7 +23,8 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* ffStrbufInitStatic(&gpu->vendor, ffGPUGetVendorString(dev.vendor_id)); ffStrbufInit(&gpu->name); ffStrbufInit(&gpu->driver); - ffStrbufInit(&gpu->platformApi); + ffStrbufInitStatic(&gpu->platformApi, POKE_DEVICE_FULLNAME); + ffStrbufInit(&gpu->memoryType); gpu->temperature = FF_GPU_TEMP_UNSET; gpu->coreCount = FF_GPU_CORE_COUNT_UNSET; gpu->coreUsage = FF_GPU_CORE_USAGE_UNSET; diff --git a/src/detection/gpu/gpu_linux.c b/src/detection/gpu/gpu_linux.c index f2563917b..ea108f460 100644 --- a/src/detection/gpu/gpu_linux.c +++ b/src/detection/gpu/gpu_linux.c @@ -438,6 +438,7 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf ffStrbufInit(&gpu->name); ffStrbufInit(&gpu->driver); ffStrbufInit(&gpu->platformApi); + ffStrbufInit(&gpu->memoryType); gpu->index = FF_GPU_INDEX_UNSET; gpu->temperature = FF_GPU_TEMP_UNSET; gpu->coreUsage = FF_GPU_CORE_USAGE_UNSET; @@ -632,6 +633,7 @@ static const char* detectOf(FFlist* gpus, FFstrbuf* buffer, FFstrbuf* drmDir, co ffStrbufInit(&gpu->name); ffStrbufInit(&gpu->vendor); ffStrbufInit(&gpu->driver); + ffStrbufInit(&gpu->memoryType); ffStrbufInitF(&gpu->platformApi, "DRM (%s)", drmKey); gpu->temperature = FF_GPU_TEMP_UNSET; gpu->coreCount = FF_GPU_CORE_COUNT_UNSET; diff --git a/src/detection/gpu/gpu_sunos.c b/src/detection/gpu/gpu_sunos.c index 8c59f7dc6..5ea80eb09 100644 --- a/src/detection/gpu/gpu_sunos.c +++ b/src/detection/gpu/gpu_sunos.c @@ -9,7 +9,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate(); const char* error = ffProcessAppendStdOut(&buffer, (char* const[]) { - "scanpci", + "/usr/bin/scanpci", "-v", NULL, }); @@ -51,9 +51,10 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* FFGPUResult* gpu = (FFGPUResult*)ffListAdd(gpus); ffStrbufInitStatic(&gpu->vendor, ffGPUGetVendorString(vendorId)); + ffStrbufInit(&gpu->memoryType); ffStrbufInit(&gpu->name); ffStrbufInit(&gpu->driver); - ffStrbufInit(&gpu->platformApi); + ffStrbufInitStatic(&gpu->platformApi, "/usr/bin/scanpci"); gpu->index = FF_GPU_INDEX_UNSET; gpu->temperature = FF_GPU_TEMP_UNSET; gpu->coreCount = FF_GPU_CORE_COUNT_UNSET; diff --git a/src/detection/gpu/gpu_windows.c b/src/detection/gpu/gpu_windows.c index 7543392d9..758ab323b 100644 --- a/src/detection/gpu/gpu_windows.c +++ b/src/detection/gpu/gpu_windows.c @@ -37,6 +37,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* ffStrbufInit(&gpu->vendor); ffStrbufInit(&gpu->name); ffStrbufInit(&gpu->driver); + ffStrbufInit(&gpu->memoryType); ffStrbufInitStatic(&gpu->platformApi, "SetupAPI"); gpu->index = FF_GPU_INDEX_UNSET; gpu->temperature = FF_GPU_TEMP_UNSET; diff --git a/src/detection/gpu/gpu_wsl.cpp b/src/detection/gpu/gpu_wsl.cpp index d8d7700b0..1ab5bb27d 100644 --- a/src/detection/gpu/gpu_wsl.cpp +++ b/src/detection/gpu/gpu_wsl.cpp @@ -70,6 +70,7 @@ const char* ffGPUDetectByDirectX(FF_MAYBE_UNUSED const FFGPUOptions* options, FF FFGPUResult* gpu = (FFGPUResult*) ffListAdd(gpus); ffStrbufInitS(&gpu->name, desc); + ffStrbufInit(&gpu->memoryType); gpu->index = FF_GPU_INDEX_UNSET; gpu->coreCount = FF_GPU_CORE_COUNT_UNSET; gpu->coreUsage = FF_GPU_CORE_USAGE_UNSET; diff --git a/src/modules/gpu/gpu.c b/src/modules/gpu/gpu.c index e8cf55cae..77799b367 100644 --- a/src/modules/gpu/gpu.c +++ b/src/modules/gpu/gpu.c @@ -153,6 +153,7 @@ static void printGPUResult(FFGPUOptions* options, uint8_t index, const FFGPUResu FF_FORMAT_ARG(sPercentBar, "shared-percentage-bar"), FF_FORMAT_ARG(coreUsageNum, "core-usage-num"), FF_FORMAT_ARG(coreUsageBar, "core-usage-bar"), + FF_FORMAT_ARG(gpu->memoryType, "memory-type"), })); } } @@ -411,6 +412,8 @@ void ffGenerateGPUJsonResult(FFGPUOptions* options, yyjson_mut_doc* doc, yyjson_ else yyjson_mut_obj_add_null(doc, sharedObj, "used"); + yyjson_mut_obj_add_strbuf(doc, obj, "memoryType", &gpu->memoryType); + if(gpu->temperature == gpu->temperature) //FF_GPU_TEMP_UNSET yyjson_mut_obj_add_real(doc, obj, "temperature", gpu->temperature); else @@ -469,8 +472,9 @@ static FFModuleBaseInfo ffModuleInfo = { {"Dedicated memory usage percentage bar", "dedicated-percentage-bar"}, {"Shared memory usage percentage num", "shared-percentage-num"}, {"Shared memory usage percentage bar", "shared-percentage-bar"}, - {"Core usage percentage num (supports Nvidia & Apple GPU only)", "core-usage-num"}, - {"Core usage percentage bar (supports Nvidia & Apple GPU only)", "core-usage-bar"}, + {"Core usage percentage num", "core-usage-num"}, + {"Core usage percentage bar", "core-usage-bar"}, + {"Memory type (Windows only)", "memory-type"}, })), };