This chapter describes the methods that query for DCGM topology information.


dcgmReturn_t dcgmSelectGpusByTopology(dcgmHandle_t pDcgmHandle, uint64_t inputGpuIds, uint32_t numGpus, uint64_t *outputGpuIds, uint64_t hintFlags)

Get the best group of gpus from the specified bitmask according to topological proximity: cpuAffinity, NUMA node, and NVLink.

  • pDcgmHandle – IN: DCGM Handle

  • inputGpuIds – IN: a bitmask of which GPUs DCGM should consider. If some of the GPUs on the system are already in use, they shouldn’t be included in the bitmask. 0 means that all of the GPUs in the system should be considered.

  • numGpus – IN: the number of GPUs that are desired from inputGpuIds. If this number is greater than the number of healthy GPUs in inputGpuIds, then less than numGpus gpus will be specified in outputGpuIds.

  • outputGpuIds – OUT: a bitmask of numGpus or fewer GPUs from inputGpuIds that represent the best placement available from inputGpuIds.

  • hintFlags – IN: a bitmask of DCGM_TOPO_HINT_F_ #defines of hints that should be taken into account when assigning outputGpuIds.