GPU (Linux): fix detection in some cases

This commit is contained in:
李通洲
2024-01-31 18:58:48 +08:00
parent 527ec1bc61
commit 60ed822f6a
+1 -3
View File
@@ -88,16 +88,14 @@ static const char* pciDetectGPUs(const FFGPUOptions* options, FFlist* gpus)
if(entry->d_name[0] == '.')
continue;
ffStrbufSubstrBefore(&pciDir, pciBaseDirLength);
ffStrbufAppendS(&pciDir, entry->d_name);
const uint32_t pciDevDirLength = pciDir.length;
ffStrbufAppendS(&pciDir, "/modalias");
if (!ffReadFileBuffer(pciDir.chars, &buffer))
{
ffStrbufSubstrBefore(&pciDir, pciBaseDirLength);
continue;
}
ffStrbufSubstrBefore(&pciDir, pciDevDirLength);
uint32_t vendorId, deviceId;