Skip to content

Compile bug: I tried compiling llama.cpp for HIP on my system (elementaryOS 8/ubuntu 24.04, rocm 6.4.0, gfx1100) using the installation guide #13340

Open
@chowdri

Description

@chowdri

Git commit

$ git rev-parse HEAD

36c258e

Operating systems

Linux

GGML backends

HIP

Problem description & steps to reproduce

I tried compiling llama.cpp for HIP on my system (elementaryOS 8/ubuntu 24.04, rocm 6.4.0, gfx1100) using the installation guide : https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md

It gives multiple errors and exits midway (it seems). I dont have to skills and insights to know what went wrong.

This bug reporting UI doesn't let me place the full output because it exceeds character limit. I have pasted the last few lines of the error output.

First Bad Commit

No response

Compile command

$ HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" cmake -S . -B build -DGGML_HIP=ON -DAMDGPU_TARGETS=gfx1100 -DCMAKE_BUILD_TYPE=Release -DGGML_HIP_ROCWMMA_FATTN=ON && cmake --build build --config Release -- -j 16

Relevant log output

[ 45%] Linking CXX executable ../../bin/llama-gguf-hash
[ 45%] Built target llama-gguf-hash
[ 45%] Linking CXX shared library ../bin/libllama.so
[ 45%] Built target llama
[ 46%] Building CXX object common/CMakeFiles/common.dir/arg.cpp.o
[ 46%] Building CXX object common/CMakeFiles/common.dir/common.cpp.o
[ 46%] Building C object tests/CMakeFiles/test-c.dir/test-c.c.o
[ 46%] Building CXX object common/CMakeFiles/common.dir/chat.cpp.o
[ 48%] Building CXX object common/CMakeFiles/common.dir/log.cpp.o
[ 48%] Building CXX object examples/simple/CMakeFiles/llama-simple.dir/simple.cpp.o
[ 48%] Building CXX object common/CMakeFiles/common.dir/llguidance.cpp.o
[ 48%] Building CXX object common/CMakeFiles/common.dir/ngram-cache.cpp.o
[ 48%] Building CXX object common/CMakeFiles/common.dir/json-schema-to-grammar.cpp.o
[ 48%] Building CXX object common/CMakeFiles/common.dir/console.cpp.o
[ 48%] Building CXX object examples/simple-chat/CMakeFiles/llama-simple-chat.dir/simple-chat.cpp.o
[ 48%] Building CXX object examples/llava/CMakeFiles/llava.dir/llava.cpp.o
[ 49%] Building CXX object common/CMakeFiles/common.dir/sampling.cpp.o
[ 49%] Building CXX object examples/llava/CMakeFiles/llava.dir/clip.cpp.o
[ 49%] Building CXX object examples/quantize-stats/CMakeFiles/llama-quantize-stats.dir/quantize-stats.cpp.o
[ 50%] Building CXX object common/CMakeFiles/common.dir/speculative.cpp.o
[ 51%] Linking C executable ../bin/test-c
[ 51%] Built target test-c
[ 52%] Linking CXX executable ../../bin/llama-simple
[ 52%] Built target llama-simple
[ 52%] Linking CXX executable ../../bin/llama-simple-chat
[ 52%] Built target llama-simple-chat
[ 53%] Linking CXX executable ../../bin/llama-quantize-stats
/usr/bin/ld: CMakeFiles/llama-quantize-stats.dir/quantize-stats.cpp.o: warning: relocation against `LLAMA_BUILD_NUMBER' in read-only section `.text.startup'
/usr/bin/ld: CMakeFiles/llama-quantize-stats.dir/quantize-stats.cpp.o: in function `main':
quantize-stats.cpp:(.text.startup+0x1c0): undefined reference to `LLAMA_COMMIT'
/usr/bin/ld: quantize-stats.cpp:(.text.startup+0x1c7): undefined reference to `LLAMA_BUILD_NUMBER'
/usr/bin/ld: quantize-stats.cpp:(.text.startup+0x1f6): undefined reference to `LLAMA_BUILD_TARGET'
/usr/bin/ld: quantize-stats.cpp:(.text.startup+0x1fd): undefined reference to `LLAMA_COMPILER'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
gmake[2]: *** [examples/quantize-stats/CMakeFiles/llama-quantize-stats.dir/build.make:104: bin/llama-quantize-stats] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:3798: examples/quantize-stats/CMakeFiles/llama-quantize-stats.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 53%] Built target llava
[ 53%] Linking CXX static library libcommon.a
[ 53%] Built target common
gmake: *** [Makefile:146: all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions