Skip to content

fix: add pynvml fallback for unified memory architectures (e.g., GB10) - #22

Merged
foreverlms merged 1 commit into
NVIDIA:mainfrom
KevinLingcc:fix/pynvml-unified-memory-fallback
Jun 7, 2026
Merged

fix: add pynvml fallback for unified memory architectures (e.g., GB10)#22
foreverlms merged 1 commit into
NVIDIA:mainfrom
KevinLingcc:fix/pynvml-unified-memory-fallback

Conversation

@KevinLingcc

Copy link
Copy Markdown
Contributor

On unified memory architectures like NVIDIA GB10 (DGX Spark), pynvml.nvmlDeviceGetMemoryInfo() raises NVMLError_NotSupported because there is no dedicated GPU memory.

This change wraps the pynvml call in a try/except and falls back to torch.cuda.get_device_properties().total_memory when pynvml fails. If CUDA is also unavailable, defaults to 128GB.

Co-authored-by: Claude

On unified memory architectures like NVIDIA GB10 (DGX Spark),
pynvml.nvmlDeviceGetMemoryInfo() raises NVMLError_NotSupported
because there is no dedicated GPU memory.

This change wraps the pynvml call in a try/except and falls back
to torch.cuda.get_device_properties().total_memory when pynvml
fails. If CUDA is also unavailable, defaults to 128GB.

Co-authored-by: Claude

@lfengad lfengad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@foreverlms
foreverlms merged commit b954bab into NVIDIA:main Jun 7, 2026
6 checks passed
rahul-steiger-nv pushed a commit to rahul-steiger-nv/cosmos-framework that referenced this pull request Jun 15, 2026
NVIDIA#22)

On unified memory architectures like NVIDIA GB10 (DGX Spark),
pynvml.nvmlDeviceGetMemoryInfo() raises NVMLError_NotSupported because
there is no dedicated GPU memory.

This change wraps the pynvml call in a try/except and falls back to
torch.cuda.get_device_properties().total_memory when pynvml fails. If
CUDA is also unavailable, defaults to 128GB.

Co-authored-by: Claude

Co-authored-by: Kun Ling <kun.lingcc@foxmail.com>
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.

4 participants