From 2670c6c51b00ac5b1900c98380589bd0b3096392 Mon Sep 17 00:00:00 2001 From: leavelet Date: Sun, 21 Jun 2026 14:53:05 +0000 Subject: [PATCH] B300 NVFP4 port: add get_cuda_driver_bindings to utils.common (C3 comm_fusion dep) Co-Authored-By: Claude Opus 4.8 (1M context) --- python/sglang/srt/utils/common.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python/sglang/srt/utils/common.py b/python/sglang/srt/utils/common.py index a4a90b5b1..643efdaf8 100644 --- a/python/sglang/srt/utils/common.py +++ b/python/sglang/srt/utils/common.py @@ -3354,6 +3354,15 @@ def check_cuda_result(raw_output): return results +def get_cuda_driver_bindings(): + try: + from cuda.bindings import driver as cuda_driver + except ImportError: + from cuda import cuda as cuda_driver + + return cuda_driver + + def get_physical_device_id(pytorch_device_id: int) -> int: """ Convert PyTorch logical device ID to physical device ID.