From: Rail Chabdarov Date: Thu, 19 Mar 2026 18:14:08 +0000 (+0100) Subject: hip: Avoid compiler bug in RDNA code generation during debug builds on Windows (... X-Git-Tag: upstream/0.0.8611~171 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=340807273b6aa765c9353804b7ce680920373cb6;p=pkg%2Fggml%2Fsources%2Fllama.cpp hip: Avoid compiler bug in RDNA code generation during debug builds on Windows (#20655) --- diff --git a/ggml/src/ggml-hip/CMakeLists.txt b/ggml/src/ggml-hip/CMakeLists.txt index c23577226..f96c6e09a 100644 --- a/ggml/src/ggml-hip/CMakeLists.txt +++ b/ggml/src/ggml-hip/CMakeLists.txt @@ -129,6 +129,11 @@ endif() if (CXX_IS_HIPCC) set_source_files_properties(${GGML_SOURCES_ROCM} PROPERTIES LANGUAGE CXX) + if (WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug") + # CMake on Windows doesn't support the HIP language yet. + # Therefore we workaround debug build's failure on HIP backend this way. + set_source_files_properties(${GGML_SOURCES_ROCM} PROPERTIES COMPILE_FLAGS "-O2 -g") + endif() target_link_libraries(ggml-hip PRIVATE hip::device) else() set_source_files_properties(${GGML_SOURCES_ROCM} PROPERTIES LANGUAGE HIP)