17 #include <hwloc/autogen/config.h>
18 #include <hwloc/helper.h>
19 #ifdef HWLOC_LINUX_SYS
20 #include <hwloc/linux.h>
55 static __hwloc_inline
int
59 #ifdef HWLOC_LINUX_SYS
61 #define HWLOC_NVML_DEVICE_SYSFS_PATH_MAX 128
62 char path[HWLOC_NVML_DEVICE_SYSFS_PATH_MAX];
72 nvres = nvmlDeviceGetPciInfo(device, &pci);
73 if (NVML_SUCCESS != nvres) {
78 sprintf(path,
"/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus", pci.domain, pci.bus, pci.device);
79 sysfile = fopen(path,
"r");
115 && !strncmp(
"nvml", osdev->
name, 4)
116 && atoi(osdev->
name + 4) == (
int) idx)
147 nvres = nvmlDeviceGetPciInfo(device, &pci);
148 if (NVML_SUCCESS != nvres)
154 if (strncmp(osdev->
name,
"nvml", 4))