From c2dd81a8aa95e04d16c20c587a9faedec10c48ed Mon Sep 17 00:00:00 2001 From: Cheng Date: Thu, 12 Jun 2025 22:03:01 +0900 Subject: [PATCH] Fix warnings from latest CUDA toolkit (#2275) --- mlx/backend/cuda/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mlx/backend/cuda/CMakeLists.txt b/mlx/backend/cuda/CMakeLists.txt index d5041b2ae..e4f36074a 100644 --- a/mlx/backend/cuda/CMakeLists.txt +++ b/mlx/backend/cuda/CMakeLists.txt @@ -44,12 +44,16 @@ target_compile_options(mlx # CUDA 12.8 emits warning #20280-D for copy kernels which is a false positive. # Explicitly pass this flag to suppress the warning, it is safe to set it to # true but the warning wouldn't be suppressed. -if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8) +if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8.0) target_compile_options( mlx PRIVATE "$<$:--static-global-template-stub=false>") endif() +# Suppress warning when building for compute capability 7 used by V100. +target_compile_options( + mlx PRIVATE "$<$:--Wno-deprecated-gpu-targets>") + # Compute capability 7 is required for synchronization between CPU/GPU with # managed memory. TODO: Add more architectures for potential performance gain. set(MLX_CUDA_ARCHITECTURES