GPU (Linux): Support Moore Threads GPU (#1142)

* feat: Support Moore Threads GPU

Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>

* Fix spell check

Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>

* Fix frequency and add back util

Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>

* Add name field

Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>

---------

Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
This commit is contained in:
R0CKSTAR
2024-08-02 16:00:54 +08:00
committed by GitHub
parent 45659854d2
commit d96d794d1f
7 changed files with 339 additions and 0 deletions
+23
View File
@@ -373,6 +373,29 @@ static const char* detectPci(const FFGPUOptions* options, FFlist* gpus, FFstrbuf
gpu->type = FF_GPU_TYPE_DISCRETE;
}
}
else if (gpu->vendor.chars == FF_GPU_VENDOR_NAME_MTHREADS)
{
if (options->temp || options->driverSpecific)
{
ffDetectMthreadsGpuInfo(&(FFGpuDriverCondition){
.type = FF_GPU_DRIVER_CONDITION_TYPE_BUS_ID,
.pciBusId = {
.domain = pciDomain,
.bus = pciBus,
.device = pciDevice,
.func = pciFunc,
},
},
(FFGpuDriverResult){
.temp = options->temp ? &gpu->temperature : NULL,
.memory = options->driverSpecific ? &gpu->dedicated : NULL,
.coreCount = options->driverSpecific ? (uint32_t*) &gpu->coreCount : NULL,
.type = &gpu->type,
.frequency = options->driverSpecific ? &gpu->frequency : NULL,
},
"libmtml.so");
}
}
return NULL;
}