Skip to content

Commit 6508ccf

Browse files
committed
FreeBSD: debug
1 parent d0a8d3c commit 6508ccf

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/detection/gpu/gpu_linux.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,15 @@ FF_MAYBE_UNUSED static void pciDetectType(FFGPUResult* gpu)
204204

205205
static void pciHandleDevice(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* results, PCIData* pci, struct pci_dev* device)
206206
{
207+
puts("10");
207208
pci->ffpci_fill_info(device, PCI_FILL_CLASS);
208209

210+
puts("11");
211+
209212
char class[1024];
210213
pci->ffpci_lookup_name(pci->access, class, sizeof(class) - 1, PCI_LOOKUP_CLASS, device->device_class);
211214

215+
puts("12");
212216
if(
213217
//https://pci-ids.ucw.cz/read/PD/03
214218
strcasecmp("VGA compatible controller", class) != 0 &&
@@ -217,19 +221,25 @@ static void pciHandleDevice(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
217221
strcasecmp("Display controller", class) != 0
218222
) return;
219223

224+
puts("13");
220225
pci->ffpci_fill_info(device, PCI_FILL_IDENT);
221226

222227
FFGPUResult* gpu = ffListAdd(results);
228+
puts("14");
223229

224230
ffStrbufInit(&gpu->vendor);
225231
pciDetectVendorName(gpu, pci, device);
232+
puts("15");
226233

227234
ffStrbufInit(&gpu->name);
228235
pciDetectDeviceName(gpu, pci, device);
236+
puts("16");
229237

230238
ffStrbufInit(&gpu->driver);
231239
pciDetectDriverName(gpu, pci, device);
232240

241+
puts("17");
242+
233243
#if FF_USE_PCI_MEMORY
234244
// Libpci reports at least 2 false results (#495, #497)
235245
pciDetectMemory(gpu, pci, device);
@@ -238,12 +248,14 @@ static void pciHandleDevice(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
238248
gpu->dedicated.used = gpu->shared.used = gpu->dedicated.total = gpu->shared.total = FF_GPU_VMEM_SIZE_UNSET;
239249
gpu->type = FF_GPU_TYPE_UNKNOWN;
240250
#endif
251+
puts("18");
241252

242253
gpu->coreCount = FF_GPU_CORE_COUNT_UNSET;
243254
gpu->temperature = FF_GPU_TEMP_UNSET;
244255

245256
if (gpu->vendor.chars == FF_GPU_VENDOR_NAME_NVIDIA && (options->temp || options->useNvml))
246257
{
258+
puts("19");
247259
char pciDeviceId[32];
248260
snprintf(pciDeviceId, sizeof(pciDeviceId) - 1, "%04x:%02x:%02x.%d", device->domain, device->bus, device->dev, device->func);
249261

@@ -253,14 +265,17 @@ static void pciHandleDevice(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
253265
.coreCount = options->useNvml ? (uint32_t*) &gpu->coreCount : NULL,
254266
}, "libnvidia-ml.so");
255267

268+
puts("20");
256269
if (gpu->dedicated.total != FF_GPU_VMEM_SIZE_UNSET)
257270
gpu->type = gpu->dedicated.total > 1024 * 1024 * 1024 ? FF_GPU_TYPE_DISCRETE : FF_GPU_TYPE_INTEGRATED;
258271
}
259272

273+
puts("21");
260274
#ifdef __linux__
261275
if(options->temp && gpu->temperature != gpu->temperature)
262276
pciDetectTemp(gpu, device);
263277
#endif
278+
puts("22");
264279
}
265280

266281
jmp_buf pciInitJmpBuf;
@@ -306,6 +321,8 @@ static const char* pciDetectGPUs(const FFGPUOptions* options, FFlist* gpus)
306321
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libpci, pci, pci_get_string_property);
307322
#endif
308323

324+
puts("1");
325+
309326
pci.access = ffpci_alloc();
310327
pci.access->warning = handlePciWarning;
311328
pci.access->error = handlePciInitError;
@@ -315,15 +332,22 @@ static const char* pciDetectGPUs(const FFGPUOptions* options, FFlist* gpus)
315332
return "pcilib: Cannot find any working access method.";
316333
pci.access->error = handlePciGenericError; // set back to generic error so we don't mess up error handling in other places
317334

335+
336+
puts("2");
337+
318338
ffpci_scan_bus(pci.access);
319339

340+
puts("3");
341+
320342
struct pci_dev* device = pci.access->devices;
321343
while(device != NULL)
322344
{
323345
pciHandleDevice(options, gpus, &pci, device);
324346
device = device->next;
325347
}
326348

349+
puts("done");
350+
327351
ffpci_cleanup(pci.access);
328352
return NULL;
329353
}

0 commit comments

Comments
 (0)