Skip to content

Commit

Permalink
Fix amdgpu wrong tx/rx computation
Browse files Browse the repository at this point in the history
  • Loading branch information
Syllo committed May 21, 2023
1 parent 9b3c12c commit 04721e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/extract_gpuinfo_amdgpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,9 @@ static void gpuinfo_amdgpu_refresh_dynamic_info(struct gpu_info *_gpu_info) {
int NreadPatterns =
rewindAndReadPattern(gpu_info->PCIeBW, "%" SCNu64 " %" SCNu64 " %i", &received, &transmitted, &maxPayloadSize);
if (NreadPatterns == 3) {
received *= maxPayloadSize;
transmitted *= maxPayloadSize;
// Compute received/transmitter in KiB
received *= maxPayloadSize / 1024;
transmitted *= maxPayloadSize / 1024;
SET_GPUINFO_DYNAMIC(dynamic_info, pcie_rx, received);
SET_GPUINFO_DYNAMIC(dynamic_info, pcie_tx, transmitted);
}
Expand Down

0 comments on commit 04721e3

Please sign in to comment.