Mozilla-Ocho / llamafile

Distribute and run LLMs with a single file.
https://llamafile.ai
Other
19.39k stars 982 forks source link

Compilation error with ROCM: fatal error: 'cmath' file not found #406

Closed huangjs closed 4 months ago

huangjs commented 4 months ago

I got the following error message on a laptop with AMD integrated CPU (780m) of architecture code gfx1103. I've tested that ROCM is properly installed and Ollama:rocm works as expected.

Is it because the architecture gfx1103 is not supported?

import_cuda_impl: initializing gpu module...
get_rocm_bin_path: note: hipInfo not found on $PATH
get_rocm_bin_path: note: $HIP_PATH/bin/hipInfo does not exist
get_rocm_bin_path: note: /opt/rocm/bin/hipInfo does not exist
llamafile_log_command: /usr/bin/rocminfo
llamafile_log_command: hipcc -O3 -fPIC -shared -DNDEBUG --offload-arch=gfx1103 -march=native -mtune=native -DGGML_BUILD=1 -DGGML_S HARED=1 -Wno-return-type -Wno-unused-result -DGGML_USE_HIPBLAS -DGGML_CUDA_MMV_Y=1 -DGGML_MULTIPLATFORM -DGGML_CUDA_DMMV_X=32 -DIG NORE4 -DK_QUANTS_PER_ITERATION=2 -DGGML_CUDA_PEER_MAX_BATCH_SIZE=128 -DIGNORE -o /home/hjs/.llamafile/ggml-rocm.so.0safgx /home/hj s/.llamafile/ggml-cuda.cu -lhipblas -lrocblas
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_AU:en",
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_AU.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_AU.UTF-8").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_AU:en",
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_AU.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_AU.UTF-8"). In file included from :1:
In file included from /opt/rocm-6.1.0/lib/llvm/lib/clang/17/include/__clang_hip_runtime_wrapper.h:50: /opt/rocm-6.1.0/lib/llvm/lib/clang/17/include/cuda_wrappers/cmath:27:15: fatal error: 'cmath' file not found 27 | #include_next
| ^~~
1 error generated when compiling for gfx1103.
Compile: warning: hipcc returned nonzero exit status extract_cuda_dso: note: prebuilt binary /zip/ggml-rocm.so not found

Janghou commented 4 months ago

FYI had same error, gone after: sudo apt install libstdc++-12-dev

huangjs commented 4 months ago

Thanks! It solves this issue.