Skip to content
Closed
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@ endif()
#
find_package(Torch REQUIRED)

# Warn on '+PTX' only when it appears as an arch suffix (e.g., 8.9+PTX)
if(DEFINED ENV{TORCH_CUDA_ARCH_LIST})
string(REPLACE "," ";" _vllm_archs "$ENV{TORCH_CUDA_ARCH_LIST}")
string(REPLACE " " ";" _vllm_archs "${_vllm_archs}")
foreach(_tok ${_vllm_archs})
string(TOUPPER _tok_up "${_tok}")
if(_tok_up MATCHES "\\+PTX$")
message(WARNING
"Detected '+PTX' in TORCH_CUDA_ARCH_LIST; PTX builds are not supported "
"via global arch list in vLLM and will be ignored. Remove '+PTX' to silence.")
break()
endif()
endforeach()
endif()

# Supported NVIDIA architectures.
# This check must happen after find_package(Torch) because that's when CMAKE_CUDA_COMPILER_VERSION gets defined
if(DEFINED CMAKE_CUDA_COMPILER_VERSION AND
Expand Down