Add vLLM-metax vllm metax cmake presets cudacxx#304
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the CMake presets generation script to detect the CUDA compiler using the CUDACXX environment variable, prioritizing it over CUDA_HOME. A corresponding unit test was also added to verify this behavior. The review feedback suggests resolving CUDACXX using which if it is specified as a command name rather than an absolute path, ensuring that compilers in the system PATH are correctly detected.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| cudacxx = os.environ.get("CUDACXX") | ||
| if cudacxx and os.path.exists(cudacxx): | ||
| nvcc_path = cudacxx | ||
| print(f"Found CUDA compiler via CUDACXX: {nvcc_path}") |
There was a problem hiding this comment.
If the CUDACXX environment variable is set to a compiler command name (e.g., nvcc or clang++) rather than an absolute path, os.path.exists(cudacxx) will return False. This causes the script to ignore the user's specified compiler and fall back to detecting nvcc elsewhere, which is incorrect. Resolving the compiler using which(cudacxx) when it is not a direct path ensures that command names in the system PATH are correctly detected and respected.
| cudacxx = os.environ.get("CUDACXX") | |
| if cudacxx and os.path.exists(cudacxx): | |
| nvcc_path = cudacxx | |
| print(f"Found CUDA compiler via CUDACXX: {nvcc_path}") | |
| cudacxx = os.environ.get("CUDACXX") | |
| if cudacxx: | |
| resolved_cudacxx = cudacxx if os.path.exists(cudacxx) else which(cudacxx) | |
| if resolved_cudacxx: | |
| nvcc_path = resolved_cudacxx | |
| print(f"Found CUDA compiler via CUDACXX: {nvcc_path}") |
Summary
Validation
Review notes