GPU (Windows): support vmem total / usage detection #416

vmem usage detection is guarded behind `--allow-slow-operations`
because it's really slow sometimes
This commit is contained in:
李通洲
2023-02-11 02:29:26 +08:00
parent f05d134aa7
commit b90d543afc
6 changed files with 78 additions and 33 deletions
+7 -2
View File
@@ -7,6 +7,7 @@
#define FF_GPU_TEMP_UNSET (0/0.0)
#define FF_GPU_CORE_COUNT_UNSET -1
#define FF_GPU_VMEM_SIZE_UNSET ((uint64_t)-1)
extern const char* FF_GPU_VENDOR_NAME_APPLE;
extern const char* FF_GPU_VENDOR_NAME_AMD;
@@ -15,20 +16,24 @@ extern const char* FF_GPU_VENDOR_NAME_NVIDIA;
typedef enum FFGpuType
{
FF_GPU_TYPE_UNKNOWN,
FF_GPU_TYPE_INTEGRATED,
FF_GPU_TYPE_DISCRETE,
FF_GPU_TYPE_UNKNOWN
} FFGpuType;
typedef struct FFGPUResult
{
uint64_t id;
FFGpuType type;
FFstrbuf vendor;
FFstrbuf name;
FFstrbuf driver;
double temperature;
uint64_t memory;
int coreCount;
uint64_t dedicatedTotal;
uint64_t dedicatedUsed;
uint64_t sharedTotal;
uint64_t sharedUsed;
} FFGPUResult;
const FFlist* ffDetectGPU(const FFinstance* instance);