@@ -124,11 +124,11 @@ AdjacencyMatrix<Links> get_nvlink_matrix() {
124
124
std::unordered_map<Node, uint32_t > cuda_device_to_nvml_device;
125
125
126
126
for (const auto i : c10::irange (device_count)) {
127
- nvmlDevice_t handle;
127
+ nvmlDevice_t handle = nullptr ;
128
128
NVML_CHECK (nvmlDeviceGetHandleByIndex (i, &handle));
129
129
nvmlPciInfo_t pci_info;
130
130
NVML_CHECK (nvmlDeviceGetPciInfo (handle, &pci_info));
131
- std::array<char , NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE> pci_bus_id;
131
+ std::array<char , NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE> pci_bus_id{} ;
132
132
std::copy (
133
133
&pci_info.busId [0 ],
134
134
&pci_info.busId [NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE],
@@ -148,7 +148,7 @@ AdjacencyMatrix<Links> get_nvlink_matrix() {
148
148
149
149
std::vector<Links> links (world_size * world_size);
150
150
for (const auto i : c10::irange (world_size)) {
151
- nvmlDevice_t handle;
151
+ nvmlDevice_t handle = nullptr ;
152
152
NVML_CHECK (
153
153
nvmlDeviceGetHandleByIndex (cuda_device_to_nvml_device[i], &handle));
154
154
for (const auto link : c10::irange (NVML_NVLINK_MAX_LINKS)) {
@@ -163,7 +163,7 @@ AdjacencyMatrix<Links> get_nvlink_matrix() {
163
163
}
164
164
nvmlPciInfo_t pci_info;
165
165
NVML_CHECK (nvmlDeviceGetNvLinkRemotePciInfo (handle, link, &pci_info));
166
- std::array<char , NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE> pci_bus_id;
166
+ std::array<char , NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE> pci_bus_id{} ;
167
167
std::copy (
168
168
&pci_info.busId [0 ],
169
169
&pci_info.busId [NVML_DEVICE_PCI_BUS_ID_BUFFER_SIZE],
0 commit comments