Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
60468da4
Unverified
Commit
60468da4
authored
Jul 20, 2025
by
Garry Fang
Committed by
GitHub
Jul 19, 2025
Browse files
bugfix: fix sglang crash in NVIDIA MIG container (#8167)
Signed-off-by:
Garrybest
<
garrybest@foxmail.com
>
parent
41d33e47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
python/sglang/srt/utils.py
python/sglang/srt/utils.py
+7
-0
No files found.
python/sglang/srt/utils.py
View file @
60468da4
...
...
@@ -1422,6 +1422,13 @@ def get_nvgpu_memory_capacity():
]
if
not
memory_values
:
# Fallback to torch.cuda.mem_get_info() when failed to get memory capacity from nvidia-smi,
# typically in NVIDIA MIG mode.
if
torch
.
cuda
.
is_available
():
logger
.
warning
(
"Failed to get GPU memory capacity from nvidia-smi, falling back to torch.cuda.mem_get_info()."
)
return
torch
.
cuda
.
mem_get_info
()[
1
]
//
1024
//
1024
# unit: MB
raise
ValueError
(
"No GPU memory values found."
)
# Return the minimum memory value
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment