[GH-ISSUE #7452] makefiles should verify compiler before trying to build GPU target #30499

Closed
opened 2026-04-22 10:10:38 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @dhiltgen on GitHub (Oct 31, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7452

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

If you have the GPU libraries present, but not the compiler, we'll try to build and fail with strange errors from ccache since no compiler command was passed in.

/usr/bin/ccache  -c  -fPIC -D_GNU_SOURCE -fPIC -Wno-unused-function -std=gnu++11 -mavx -parallel-jobs=2 -c -O3 -DGGML_USE_CUDA -DGGML_BUILD=1 -DGGML_SHARED=1 -DGGML_CUDA_DMMV_X=32 -DGGML_CUDA_MMV_Y=1 -DGGML_SCHED_MAX_COPIES=4 -DGGML_USE_HIPBLAS -DGGML_USE_LLAMAFILE -DHIP_FAST_MATH -D__HIP_PLATFORM_AMD__=1 -D__HIP_ROCclr__=1 -DNDEBUG -DK_QUANTS_PER_ITERATION=2 -D_CRT_SECURE_NO_WARNINGS -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -mllvm=-amdgpu-early-inline-all=true -mllvm=-amdgpu-function-calls=false -Wno-expansion-to-defined -Wno-invalid-noreturn -Wno-ignored-attributes -Wno-pass-failed -Wno-deprecated-declarations -Wno-unused-result -I.  --offload-arch=gfx900  --offload-arch=gfx940  --offload-arch=gfx941  --offload-arch=gfx942  --offload-arch=gfx1010  --offload-arch=gfx1012  --offload-arch=gfx1030  --offload-arch=gfx1100  --offload-arch=gfx1101  --offload-arch=gfx1102  --offload-arch=gfx906:xnack-  --offload-arch=gfx908:xnack-  --offload-arch=gfx90a:xnack+  --offload-arch=gfx90a:xnack- -o /home/mike/ollama/llama/build/linux-amd64/ggml-cuda.rocm.o ggml-cuda.cu
/usr/bin/ccache: invalid option -- 'f'
make[2]: *** [make/gpu.make:75: /home/mike/ollama/llama/build/linux-amd64/ggml-cuda.rocm.o] Error 1

OS

Linux, Windows

GPU

Nvidia, AMD

CPU

No response

Ollama version

0.4.0

Originally created by @dhiltgen on GitHub (Oct 31, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7452 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? If you have the GPU libraries present, but not the compiler, we'll try to build and fail with strange errors from ccache since no compiler command was passed in. ``` /usr/bin/ccache -c -fPIC -D_GNU_SOURCE -fPIC -Wno-unused-function -std=gnu++11 -mavx -parallel-jobs=2 -c -O3 -DGGML_USE_CUDA -DGGML_BUILD=1 -DGGML_SHARED=1 -DGGML_CUDA_DMMV_X=32 -DGGML_CUDA_MMV_Y=1 -DGGML_SCHED_MAX_COPIES=4 -DGGML_USE_HIPBLAS -DGGML_USE_LLAMAFILE -DHIP_FAST_MATH -D__HIP_PLATFORM_AMD__=1 -D__HIP_ROCclr__=1 -DNDEBUG -DK_QUANTS_PER_ITERATION=2 -D_CRT_SECURE_NO_WARNINGS -D_GNU_SOURCE -D_XOPEN_SOURCE=600 -mllvm=-amdgpu-early-inline-all=true -mllvm=-amdgpu-function-calls=false -Wno-expansion-to-defined -Wno-invalid-noreturn -Wno-ignored-attributes -Wno-pass-failed -Wno-deprecated-declarations -Wno-unused-result -I. --offload-arch=gfx900 --offload-arch=gfx940 --offload-arch=gfx941 --offload-arch=gfx942 --offload-arch=gfx1010 --offload-arch=gfx1012 --offload-arch=gfx1030 --offload-arch=gfx1100 --offload-arch=gfx1101 --offload-arch=gfx1102 --offload-arch=gfx906:xnack- --offload-arch=gfx908:xnack- --offload-arch=gfx90a:xnack+ --offload-arch=gfx90a:xnack- -o /home/mike/ollama/llama/build/linux-amd64/ggml-cuda.rocm.o ggml-cuda.cu /usr/bin/ccache: invalid option -- 'f' make[2]: *** [make/gpu.make:75: /home/mike/ollama/llama/build/linux-amd64/ggml-cuda.rocm.o] Error 1 ``` ### OS Linux, Windows ### GPU Nvidia, AMD ### CPU _No response_ ### Ollama version 0.4.0
GiteaMirror added the buildbug labels 2026-04-22 10:10:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#30499