-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Related issue: sgl-project/sglang#18108
Root cause: CUDA Driver Version: 470.82.01 (too old), which leads to failure in version detectection in line 148
tvm-ffi/python/tvm_ffi/cpp/extension.py
Lines 135 to 158 in 437323c
| def _get_cuda_target() -> str: | |
| """Get the CUDA target architecture flag.""" | |
| if "TVM_FFI_CUDA_ARCH_LIST" in os.environ: | |
| arch_list = os.environ["TVM_FFI_CUDA_ARCH_LIST"].split() # e.g., "8.9 9.0a" | |
| flags = [] | |
| for arch in arch_list: | |
| if len(arch.split(".")) != 2: | |
| raise ValueError(f"Invalid CUDA architecture: {arch}") | |
| major, minor = arch.split(".") | |
| flags.append(f"-gencode=arch=compute_{major}{minor},code=sm_{major}{minor}") | |
| return " ".join(flags) | |
| else: | |
| try: | |
| status = subprocess.run( | |
| args=["nvidia-smi", "--query-gpu=compute_cap", "--format=csv,noheader"], | |
| capture_output=True, | |
| check=True, | |
| ) | |
| compute_cap = status.stdout.decode("utf-8").strip().split("\n")[0] | |
| major, minor = compute_cap.split(".") | |
| return f"-gencode=arch=compute_{major}{minor},code=sm_{major}{minor}" | |
| except Exception: | |
| # fallback to a reasonable default | |
| return "-gencode=arch=compute_70,code=sm_70" |
I wonder if users can manually specify the cuda major/minor version when building jit modules.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request