Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
96237ba1
Unverified
Commit
96237ba1
authored
Mar 04, 2026
by
Schwinn Saereesitthipitak
Committed by
GitHub
Mar 04, 2026
Browse files
fix(gms): resolve socket UUIDs via CUDA driver API (#6891)
parent
bb2ca1a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
lib/gpu_memory_service/common/utils.py
lib/gpu_memory_service/common/utils.py
+18
-10
No files found.
lib/gpu_memory_service/common/utils.py
View file @
96237ba1
...
@@ -5,15 +5,20 @@
...
@@ -5,15 +5,20 @@
import
os
import
os
import
tempfile
import
tempfile
import
uuid
import
pynvml
from
cuda.bindings
import
driver
as
cuda
from
gpu_memory_service.common.cuda_vmm_utils
import
(
check_cuda_result
,
ensure_cuda_initialized
,
)
def
get_socket_path
(
device
:
int
)
->
str
:
def
get_socket_path
(
device
:
int
)
->
str
:
"""Get GMS socket path for the given CUDA device.
"""Get GMS socket path for the given CUDA device.
The socket path is based on GPU UUID
, making it stable across different
The socket path is based on GPU UUID
resolved by CUDA.
CUDA_VISIBLE_DEVICES
configu
ration
s
.
CUDA_VISIBLE_DEVICES
remapping is handled by CUDA device enume
ration.
Args:
Args:
device: CUDA device index.
device: CUDA device index.
...
@@ -21,10 +26,13 @@ def get_socket_path(device: int) -> str:
...
@@ -21,10 +26,13 @@ def get_socket_path(device: int) -> str:
Returns:
Returns:
Socket path (e.g., "<tempdir>/gms_GPU-12345678-1234-1234-1234-123456789abc.sock").
Socket path (e.g., "<tempdir>/gms_GPU-12345678-1234-1234-1234-123456789abc.sock").
"""
"""
pynvml
.
nvmlInit
()
ensure_cuda_initialized
()
try
:
handle
=
pynvml
.
nvmlDeviceGetHandleByIndex
(
device
)
result
,
cu_device
=
cuda
.
cuDeviceGet
(
device
)
uuid
=
pynvml
.
nvmlDeviceGetUUID
(
handle
)
check_cuda_result
(
result
,
"cuDeviceGet"
)
finally
:
pynvml
.
nvmlShutdown
()
result
,
cu_uuid
=
cuda
.
cuDeviceGetUuid
(
cu_device
)
return
os
.
path
.
join
(
tempfile
.
gettempdir
(),
f
"gms_
{
uuid
}
.sock"
)
check_cuda_result
(
result
,
"cuDeviceGetUuid"
)
gpu_uuid
=
f
"GPU-
{
uuid
.
UUID
(
bytes
=
bytes
(
cu_uuid
.
bytes
))
}
"
return
os
.
path
.
join
(
tempfile
.
gettempdir
(),
f
"gms_
{
gpu_uuid
}
.sock"
)
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