@@ -168,24 +168,26 @@ static void pciHandleDevice(FFlist* results, PCIData* pci, struct pci_dev* devic
168168 ffStrbufInit (& gpu -> driver );
169169 pciDetectDriverName (gpu , pci , device );
170170
171+ gpu -> coreCount = FF_GPU_CORE_COUNT_UNSET ;
172+
171173 gpu -> temperature = FF_GPU_TEMP_UNSET ;
172174 pciDetectTemperatur (gpu , device );
173175}
174176
175- static void pciDetectGPUs (const FFinstance * instance , FFlist * gpus )
177+ static const char * pciDetectGPUs (const FFinstance * instance , FFlist * gpus )
176178{
177179 PCIData pci ;
178180
179- FF_LIBRARY_LOAD (libpci , instance -> config .libPCI , , "libpci.so" , 4 )
180- FF_LIBRARY_LOAD_SYMBOL (libpci , pci_alloc , )
181- FF_LIBRARY_LOAD_SYMBOL (libpci , pci_init , )
182- FF_LIBRARY_LOAD_SYMBOL (libpci , pci_scan_bus , )
183- FF_LIBRARY_LOAD_SYMBOL (libpci , pci_cleanup , )
181+ FF_LIBRARY_LOAD (libpci , instance -> config .libPCI , "dlopen libpci.so failed" , "libpci.so" , 4 )
182+ FF_LIBRARY_LOAD_SYMBOL_MESSAGE (libpci , pci_alloc )
183+ FF_LIBRARY_LOAD_SYMBOL_MESSAGE (libpci , pci_init )
184+ FF_LIBRARY_LOAD_SYMBOL_MESSAGE (libpci , pci_scan_bus )
185+ FF_LIBRARY_LOAD_SYMBOL_MESSAGE (libpci , pci_cleanup )
184186
185- FF_LIBRARY_LOAD_SYMBOL_VAR (libpci , pci , pci_read_byte , )
186- FF_LIBRARY_LOAD_SYMBOL_VAR (libpci , pci , pci_read_word , )
187- FF_LIBRARY_LOAD_SYMBOL_VAR (libpci , pci , pci_lookup_name , )
188- FF_LIBRARY_LOAD_SYMBOL_VAR (libpci , pci , pci_get_param , )
187+ FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE (libpci , pci , pci_read_byte )
188+ FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE (libpci , pci , pci_read_word )
189+ FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE (libpci , pci , pci_lookup_name )
190+ FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE (libpci , pci , pci_get_param )
189191
190192 pci .access = ffpci_alloc ();
191193 ffpci_init (pci .access );
@@ -200,13 +202,14 @@ static void pciDetectGPUs(const FFinstance* instance, FFlist* gpus)
200202
201203 ffpci_cleanup (pci .access );
202204 dlclose (libpci );
205+ return NULL ;
203206}
204207
205208#endif
206209
207- void ffDetectGPUImpl (FFlist * gpus , const FFinstance * instance )
210+ const char * ffDetectGPUImpl (FFlist * gpus , const FFinstance * instance )
208211{
209212 #ifdef FF_HAVE_LIBPCI
210- pciDetectGPUs (instance , gpus );
213+ return pciDetectGPUs (instance , gpus );
211214 #endif
212215}
0 commit comments