Skip to content

Commit fa5673c

Browse files
committed
CUDA: restrict PDL to CTK >= 12.3 due to MSVC issues
1 parent 0d18aaa commit fa5673c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

ggml/src/ggml-cuda/common.cuh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,14 @@
110110
# define GGML_CUDA_USE_CUB
111111
#endif // !defined(GGML_USE_HIP) && !defined(GGML_USE_MUSA) && CUDART_VERSION >= 11070
112112

113-
// PDL host-side support (cudaLaunchKernelEx) requires CUDART >= 11.8 and excludes HIP/MUSA.
113+
// PDL host-side support (cudaLaunchKernelEx) requires CUDART >= 11.8.
114+
// However, this has been bugged in CTK < 12.3 for MSVC builds, see
115+
// https://github.com/ggml-org/llama.cpp/pull/22522#discussion_r3302393293
114116
// __CUDA_ARCH__ is undefined in host passes; GPU arch check happens in device-side code.
115-
#if !defined(GGML_USE_HIP) && !defined(GGML_USE_MUSA) && CUDART_VERSION >= 11080
117+
#if !defined(GGML_USE_HIP) && !defined(GGML_USE_MUSA) && \
118+
(CUDART_VERSION >= 12030 || (!(defined(_MSC_VER) && !defined(__clang__)) && CUDART_VERSION >= 11080))
116119
# define GGML_CUDA_USE_PDL
117-
#endif // !defined(GGML_USE_HIP) && !defined(GGML_USE_MUSA) && CUDART_VERSION >= 11080
120+
#endif // !defined(GGML_USE_HIP) && !defined(GGML_USE_MUSA) && (CUDART_VERSION >= 12030 || (!(defined(_MSC_VER) && !defined(__clang__)) && CUDART_VERSION >= 11080))
118121

119122
static __device__ __forceinline__ void ggml_cuda_pdl_sync() {
120123
#if defined(GGML_CUDA_USE_PDL) && defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= GGML_CUDA_CC_HOPPER

0 commit comments

Comments
 (0)