88#include <dev/pci/pcireg.h>
99#include <sys/pciio.h>
1010#include <fcntl.h>
11- #include <paths.h>
12-
13- static bool loadPciIds (FFstrbuf * pciids )
14- {
15- // https://github.com/freebsd/freebsd-src/blob/main/usr.sbin/pciconf/pathnames.h
16-
17- ffReadFileBuffer (_PATH_LOCALBASE "/share/pciids/pci.ids" , pciids );
18- if (pciids -> length > 0 ) return true;
19-
20- ffReadFileBuffer (FASTFETCH_TARGET_DIR_USR "/share/pciids/pci.ids" , pciids );
21- if (pciids -> length > 0 ) return true;
22-
23- return false;
24- }
2511
2612const char * ffDetectGPUImpl (const FFGPUOptions * options , FFlist * gpus )
2713{
@@ -45,8 +31,6 @@ const char* ffDetectGPUImpl(const FFGPUOptions* options, FFlist* gpus)
4531 if (pcio .status == PCI_GETCONF_ERROR )
4632 return "ioctl(fd, PCIOCGETCONF, &pc) returned error" ;
4733
48- FF_STRBUF_AUTO_DESTROY pciids = ffStrbufCreate ();
49-
5034 for (uint32_t i = 0 ; i < pcio .num_matches ; ++ i )
5135 {
5236 struct pci_conf * pc = & confs [i ];
@@ -74,9 +58,7 @@ const char* ffDetectGPUImpl(const FFGPUOptions* options, FFlist* gpus)
7458
7559 if (gpu -> name .length == 0 )
7660 {
77- if (pciids .length == 0 )
78- loadPciIds (& pciids );
79- ffGPUParsePciIds (& pciids , pc -> pc_subclass , pc -> pc_vendor , pc -> pc_device , gpu );
61+ ffGPUParsePciIds (pc -> pc_subclass , pc -> pc_vendor , pc -> pc_device , gpu );
8062 }
8163
8264 if (gpu -> vendor .chars == FF_GPU_VENDOR_NAME_NVIDIA && (options -> temp || options -> driverSpecific ))
0 commit comments