Make debug build possible on Windows with HIP backend.#20655
Open
Exile333 wants to merge 2 commits intoggml-org:masterfrom
Open
Make debug build possible on Windows with HIP backend.#20655Exile333 wants to merge 2 commits intoggml-org:masterfrom
Exile333 wants to merge 2 commits intoggml-org:masterfrom
Conversation
Collaborator
|
Just use CMAKE_CXX_FLAGS_DEBUG and get rid of the debug conditional. EDIT: never mind we dont want the other CXX sources compiled with optimization turned on. |
IMbackK
approved these changes
Mar 17, 2026
Collaborator
IMbackK
left a comment
There was a problem hiding this comment.
Kind of ugly but i think that yeah this is the only way to only compile the hip sources with optimization turned on in this case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is it?
Debug build for HIP backend fails on Windows. It is known problem (see ROCm/ROCm#5826) and was previously fixed for Linux build. However, CMakeFiles.txt on Windows treat HIP files as CXX files, therefore one should provide extra treatment for Windows build.
Fix is to explicitly set "-O2" option for HIP source files at Windows debug build.
If this correction is good enough to be accepted, I will also make PRs for ggml and whisper.cpp repos.
Ways to test and reproduce.
I found this issue while trying to build llama.cpp for Strix Halo (architecture gfx1151). Most likely this error occurs not only on Strix Halo and can be reproduced at any RDNA 2/3/4 AMD GPU.
Additional tests.
Not needed, current ones are good.