2022-09-05 17:42:42 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "fastfetch.h"
|
|
|
|
|
|
|
|
|
|
#define FF_GPU_TEMP_UNSET (0/0.0)
|
2022-09-16 18:11:39 +08:00
|
|
|
#define FF_GPU_CORE_COUNT_UNSET -1
|
2023-02-11 02:29:26 +08:00
|
|
|
#define FF_GPU_VMEM_SIZE_UNSET ((uint64_t)-1)
|
2023-12-20 19:09:18 +08:00
|
|
|
#define FF_GPU_FREQUENCY_UNSET (0/0.0)
|
2022-09-05 17:42:42 +02:00
|
|
|
|
2023-02-06 11:07:49 +08:00
|
|
|
extern const char* FF_GPU_VENDOR_NAME_APPLE;
|
|
|
|
|
extern const char* FF_GPU_VENDOR_NAME_AMD;
|
|
|
|
|
extern const char* FF_GPU_VENDOR_NAME_INTEL;
|
|
|
|
|
extern const char* FF_GPU_VENDOR_NAME_NVIDIA;
|
2023-10-21 17:36:13 +08:00
|
|
|
extern const char* FF_GPU_VENDOR_NAME_VMWARE;
|
|
|
|
|
extern const char* FF_GPU_VENDOR_NAME_PARALLEL;
|
|
|
|
|
extern const char* FF_GPU_VENDOR_NAME_MICROSOFT;
|
2023-10-31 15:11:22 +08:00
|
|
|
extern const char* FF_GPU_VENDOR_NAME_REDHAT;
|
|
|
|
|
extern const char* FF_GPU_VENDOR_NAME_ORACLE;
|
2022-11-22 19:25:49 +08:00
|
|
|
|
2023-02-11 12:34:57 +08:00
|
|
|
typedef struct FFGPUMemory
|
|
|
|
|
{
|
|
|
|
|
uint64_t total;
|
|
|
|
|
uint64_t used;
|
|
|
|
|
} FFGPUMemory;
|
|
|
|
|
|
2022-09-05 17:42:42 +02:00
|
|
|
typedef struct FFGPUResult
|
|
|
|
|
{
|
2023-03-26 20:42:18 +08:00
|
|
|
FFGPUType type;
|
2022-09-05 17:42:42 +02:00
|
|
|
FFstrbuf vendor;
|
|
|
|
|
FFstrbuf name;
|
|
|
|
|
FFstrbuf driver;
|
|
|
|
|
double temperature;
|
2023-12-20 14:45:27 +08:00
|
|
|
int32_t coreCount;
|
2023-12-20 19:09:18 +08:00
|
|
|
double frequency; // Real time clock frequency in GHz
|
2023-02-11 12:34:57 +08:00
|
|
|
FFGPUMemory dedicated;
|
|
|
|
|
FFGPUMemory shared;
|
2023-12-20 14:45:27 +08:00
|
|
|
uint64_t deviceId; // Used internally, may be uninitialized
|
2022-09-05 17:42:42 +02:00
|
|
|
} FFGPUResult;
|
|
|
|
|
|
2023-06-24 10:59:53 +08:00
|
|
|
const char* ffDetectGPU(const FFGPUOptions* options, FFlist* result);
|
|
|
|
|
const char* ffDetectGPUImpl(const FFGPUOptions* options, FFlist* gpus);
|
2022-09-05 17:42:42 +02:00
|
|
|
|
2023-02-06 11:07:49 +08:00
|
|
|
const char* ffGetGPUVendorString(unsigned vendorId);
|