diff --git a/src/include/topo.h b/src/include/topo.h index 971ae68..e824a81 100644 --- a/src/include/topo.h +++ b/src/include/topo.h @@ -12,13 +12,16 @@ #include #include +#define BUSID_SIZE (sizeof("0000:00:00.0")) +#define BUSID_REDUCED_SIZE (sizeof("0000:00")) + static ncclResult_t getCudaPath(int cudaDev, char** path) { - char busId[16]; - CUDACHECK(cudaDeviceGetPCIBusId(busId, 16, cudaDev)); - for (int i=0; i<16; i++) busId[i] = tolower(busId[i]); + char busId[BUSID_SIZE]; + CUDACHECK(cudaDeviceGetPCIBusId(busId, BUSID_SIZE, cudaDev)); + for (int i=0; i