@@ -486,19 +486,34 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
486486 if (gpu -> type == FF_GPU_TYPE_UNKNOWN )
487487 {
488488 FF_DEBUG ("Using fallback GPU type detection" );
489- if (gpu -> vendor .chars == FF_GPU_VENDOR_NAME_INTEL )
489+ if (gpu -> vendor .chars == FF_GPU_VENDOR_NAME_NVIDIA )
490490 {
491+ if (ffStrbufStartsWithIgnCaseS (& gpu -> name , "GeForce" ) ||
492+ ffStrbufStartsWithIgnCaseS (& gpu -> name , "Quadro" ) ||
493+ ffStrbufStartsWithIgnCaseS (& gpu -> name , "Tesla" ))
494+ gpu -> type = FF_GPU_TYPE_DISCRETE ;
495+ }
496+ else if (gpu -> vendor .chars == FF_GPU_VENDOR_NAME_MTHREADS )
497+ {
498+ if (ffStrbufStartsWithIgnCaseS (& gpu -> name , "MTT " ))
499+ gpu -> type = FF_GPU_TYPE_DISCRETE ;
500+ }
501+ else if (gpu -> vendor .chars == FF_GPU_VENDOR_NAME_INTEL )
502+ {
503+ // 0000:00:02.0 is reserved for Intel integrated graphics
491504 gpu -> type = gpu -> deviceId == ffGPUPciAddr2Id (0 , 0 , 2 , 0 ) ? FF_GPU_TYPE_INTEGRATED : FF_GPU_TYPE_DISCRETE ;
492- FF_DEBUG ("Intel GPU type determined: %s" , gpu -> type == FF_GPU_TYPE_INTEGRATED ? "Integrated" : "Discrete" );
493505 }
506+
507+ if (gpu -> type != FF_GPU_TYPE_UNKNOWN )
508+ FF_DEBUG ("Determined GPU type based on vendor (%s) and name: %u" , gpu -> vendor .chars , gpu -> type );
494509 else if (ffIsWindows10OrGreater ())
495510 {
496511 const char * ffGPUDetectTypeWithDXCore (LUID adapterLuid , FFGPUResult * gpu );
497512 FF_MAYBE_UNUSED const char * error = ffGPUDetectTypeWithDXCore (* (LUID * )& adapterLuid , gpu );
498513 FF_DEBUG ("DXCore GPU type detection result: %s" , error ?: "Success" );
499514 }
500515 else
501- FF_DEBUG ("Unable to determine GPU type" );
516+ FF_DEBUG ("Unable to determine GPU type by any method for this adapter " );
502517 }
503518
504519 FF_DEBUG ("Completed processing GPU #%d - Vendor: %s, Name: %s, Type: %d" , deviceCount , gpu -> vendor .chars , gpu -> name .chars , gpu -> type );
0 commit comments