Skip to content

Conversation

@raphischer
Copy link
Contributor

@raphischer raphischer commented Jan 22, 2026

Description

Added error catching for the static GPU memory information. Behavior only changes when the pynvml call is not successful.

Related Issue

#1037

Motivation and Context

For the NVIDIA DGX Spark, CodeCarbon trackers currently cannot be correctly initialized. When debugging into that, I noticed that calling pynvml.nvmlDeviceGetMemoryInfo in codecarbon/core/gpu.py throws an pynvml.NVMLError_NotSupported, probably due to the shared memore architecture of the NVIDIA Blackwell GPU (internally read as NVIDIA GB10).

How Has This Been Tested?

Locally tested tracking functionality after the fix.

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Handle NVMLError_NotSupported when getting memory info for NVIDIA Blackwell GPUs
@raphischer raphischer requested a review from a team as a code owner January 22, 2026 15:08
@benoit-cty benoit-cty linked an issue Jan 22, 2026 that may be closed by this pull request
Copy link
Contributor

@benoit-cty benoit-cty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for testing and fixing CodeCarbon on DGX spark.

@raphischer
Copy link
Contributor Author

raphischer commented Jan 22, 2026

Happy I can help, and sorry about the linting issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking not supported for NVIDIA Blackwell GPUs

2 participants