@@ -122,7 +122,7 @@ namespace pmon::tel::nvml
122122 if (pMemoryInfo == nullptr ) {
123123 return (uint64_t )0 ;
124124 }
125- return GetLegacyTotalMemoryBytes_ (*pMemoryInfo);
125+ return GetTotalMemoryBytes_ (*pMemoryInfo);
126126 }
127127 case PM_METRIC_GPU_MEM_USED :
128128 {
@@ -141,7 +141,7 @@ namespace pmon::tel::nvml
141141 return 0.0 ;
142142 }
143143
144- const auto totalBytes = GetLegacyTotalMemoryBytes_ (*pMemoryInfo);
144+ const auto totalBytes = GetTotalMemoryBytes_ (*pMemoryInfo);
145145 if (totalBytes == 0 ) {
146146 return 0.0 ;
147147 }
@@ -160,9 +160,9 @@ namespace pmon::tel::nvml
160160 (void )metricId;
161161 }
162162
163- uint64_t NvmlTelemetryProvider::GetLegacyTotalMemoryBytes_ (const nvmlMemory_t& memoryInfo) noexcept
163+ uint64_t NvmlTelemetryProvider::GetTotalMemoryBytes_ (const nvmlMemory_t& memoryInfo) noexcept
164164 {
165- return (uint64_t )memoryInfo.free ;
165+ return (uint64_t )memoryInfo.total ;
166166 }
167167
168168 bool NvmlTelemetryProvider::TryInitializeDevice_ (DeviceState_& device, nvmlDevice_t handle) const
@@ -232,7 +232,7 @@ namespace pmon::tel::nvml
232232 }
233233
234234 if (const auto * pMemoryInfo = PollMemoryInfoEndpoint_ (device, requestQpc)) {
235- const auto totalBytes = GetLegacyTotalMemoryBytes_ (*pMemoryInfo);
235+ const auto totalBytes = GetTotalMemoryBytes_ (*pMemoryInfo);
236236 if (totalBytes != 0 ) {
237237 caps.Set (PM_METRIC_GPU_MEM_SIZE , 1 );
238238 caps.Set (PM_METRIC_GPU_MEM_USED , 1 );
0 commit comments