Skip to content

[Issue]: Additional environment variables and CMake flags are needed to use ROCm packaged by TheRock Windows tarball #1979

Closed

Description

@lihaofd

Problem Description

https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md#hip
with https://therock-nightly-tarball.s3.amazonaws.com/therock-dist-windows-gfx1151-7.10.0a20251028.tar.gz
Tried windows 11 with strix halo (gfx1151)
If just set HIP_PATH=therock-dist-windows-gfx1151-7.10.0a20251028 folder
When running
set HIP_PATH=therock-dist-windows-gfx1151-7.10.0a20251028_test
set PATH=%HIP_PATH%\bin;%PATH%
cmake -S . -B build -G Ninja -DGPU_TARGETS=gfx1151 -DGGML_HIP=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=OFF
cmake --build build

it will show many issue like missing files or compilation error.
So far it can be workaround by adding relative files like clang, ld,. llvm as well as amdgcn etc from general hip sdk windows package.

But it is better for support these files in native therock windows package for llama.cpp hip windows backend build

Thanks!

Operating System

windows 11

CPU

395 Max

GPU

Radeon 8060s

ROCm Version

the rock 7.10

ROCm Component

No response

Steps to Reproduce

No response

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

Activity

  1. zichguan-amd commented on Oct 31, 2025

    @zichguan-amd
    Contributor

    Hi @lihaofd, TheRock is not missing any files. All you need is to set the full path to the compiler and make sure you have a windows rc compiler. I was able to compiler with the following flags in powershell, I have the tarball unzipped to C:/therock/.

    cmake -S . -B build -G Ninja -DGPU_TARGETS=gfx1151 -DGGML_HIP=ON -DCMAKE_C_COMPILER="C:/therock/lib/llvm/bin/amdclang.exe" -DCMAKE_CXX_COMPILER="C:/therock/lib/llvm/bin/amdclang++.exe" -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=OFF -DCMAKE_RC_COMPILER="C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/rc.exe"
    

    If rc is in the path, e.g. when using the Visual Studio X64 command prompt, you can omit the CMAKE_RC_COMPILER flag.

  2. zichguan-amd commented on Oct 31, 2025

    @zichguan-amd
    Contributor

    You also likely need to set the following environment variables:

    HIP_PATH=C:\therock\
    HIP_PATH_70=C:\therock\
    LLVM_PATH=C:\therock
    HIP_PLATFORM=amd
    

    And add to PATH: C:\therock\lib\llvm\bin and C:\therock\bin

    I'm trying to cover as much as possible, some of it might not be needed. Feel free to try any combinations that might work for you.
    We need to document this or have a script for it, same as #1658.

  3. added
    status: assessedIndicates an issue has been root caused.
    and removed
    status: triageIndicates an issue has been assigned for investigation.
    on Nov 4, 2025
  4. zichguan-amd commented on Nov 6, 2025

    @zichguan-amd
    Contributor

    Hi @lihaofd, please let me know if you got it to work and feel free to comment if you still have questions or concerns.

  5. lihaofd commented on Nov 6, 2025

    @lihaofd
    Author

    Hi @lihaofd, please let me know if you got it to work and feel free to comment if you still have questions or concerns.

    HIP_PATH=C:\therock
    set HIP_PATH_70=%HIP_PATH%
    set LLVM_PATH=%HIP_PATH%
    set HIP_PLATFORM=amd
    set CMAKE_C_COMPILER=%HIP_PATH%\lib\llvm\bin\amdclang.exe
    set CMAKE_CXX_COMPILER=%HIP_PATH%\lib\llvm\bin\amdclang++.exe
    set CMAKE_RC_COMPILER="C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/rc.exe"
    set PATH=%HIP_PATH%\bin;%PATH%
    can work,thank you for help!

  6. changed the title [-][Issue]: when building hip windows backend in llama.cpp from therock, missing some compilation files on the rock windows package[/-] [+][Issue]: Additional environment variables and CMake flags are needed to use ROCm packaged by TheRock Windows tarball[/+] on Nov 6, 2025
  7. zichguan-amd commented on Nov 6, 2025

    @zichguan-amd
    Contributor

    Good to hear! I'll go ahead and close the issue. I've also changed to title to reflect the issue more accurately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions