Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues Building CPU/Specific GPU - CMake #2661

Open
bradmit opened this issue Dec 23, 2024 · 0 comments
Open

Issues Building CPU/Specific GPU - CMake #2661

bradmit opened this issue Dec 23, 2024 · 0 comments

Comments

@bradmit
Copy link
Contributor

bradmit commented Dec 23, 2024

I haven't built a version since ~ 1.6.2 and saw the new update and I am having issues compiling since going to CMake.

First issue building for CPU, will not link?

Second issue building for GPU. How do I build for a specific GPU, previously built for compute_89 but unsure how to do this now. It just complains that there is no GPU now as its configured for native.

Would be good if there was extra info in the readme with compiling to build for specific GPUs like earlier makes with gmake.

GPU BUILD

cmake -B build -DGGML_CUDA=1
-- The C compiler identification is Clang 18.1.8
-- The CXX compiler identification is GNU 8.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- Could NOT find Git (missing: GIT_EXECUTABLE)
CMake Warning at cmake/build-info.cmake:14 (message):
Git not found. Build info will not be accurate.
Call Stack (most recent call first):
CMakeLists.txt:90 (include)

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- Including CPU backend
-- Found OpenMP_C: -fopenmp=libomp
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Adding CPU backend variant ggml-cpu: -march=native
-- Found CUDAToolkit: /usr/local/cuda-12.2/include (found version "12.2.140")
-- CUDA Toolkit found
-- Using CUDA architectures: native
-- The CUDA compiler identification is NVIDIA 12.2.140
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda-12.2/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- CUDA host compiler is GNU 8.5.0

-- Including CUDA backend
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Configuring done (9.8s)
CMake Error in ggml/src/ggml-cuda/CMakeLists.txt:
CUDA_ARCHITECTURES is set to "native", but no GPU was detected.

CMake Error in ggml/src/ggml-cuda/CMakeLists.txt:
CUDA_ARCHITECTURES is set to "native", but no GPU was detected.

-- Generating done (0.4s)
CMake Generate step failed. Build files cannot be regenerated correctly.

CPU BUILD

cmake -B build-new
-- The C compiler identification is Clang 18.1.8
-- The CXX compiler identification is GNU 8.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- Could NOT find Git (missing: GIT_EXECUTABLE)
CMake Warning at cmake/build-info.cmake:14 (message):
Git not found. Build info will not be accurate.
Call Stack (most recent call first):
CMakeLists.txt:90 (include)

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- Including CPU backend
-- Found OpenMP_C: -fopenmp=libomp
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Adding CPU backend variant ggml-cpu: -march=native
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Configuring done (3.7s)
-- Generating done (0.5s)
-- Build files have been written to: /projects/third_party/whisper-cpp/whisper.cpp-1.7.3/build-new
[bradm@MTNET.COM.AU@delos whisper.cpp-1.7.3]$ cmake --build build-new --config Release
[ 3%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml.c.o
[ 6%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml-alloc.c.o
[ 9%] Building CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-backend.cpp.o
[ 12%] Building CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-opt.cpp.o
[ 15%] Building CXX object ggml/src/CMakeFiles/ggml-base.dir/ggml-threading.cpp.o
[ 18%] Building C object ggml/src/CMakeFiles/ggml-base.dir/ggml-quants.c.o
[ 21%] Linking CXX shared library libggml-base.so
[ 21%] Built target ggml-base
[ 25%] Building C object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu.c.o
[ 28%] Building CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu.cpp.o
[ 31%] Building CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu-aarch64.cpp.o
[ 34%] Building CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu-hbm.cpp.o
[ 37%] Building C object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu-quants.c.o
[ 40%] Building CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/ggml-cpu-traits.cpp.o
[ 43%] Building CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/amx/amx.cpp.o
[ 46%] Building CXX object ggml/src/CMakeFiles/ggml-cpu.dir/ggml-cpu/amx/mmq.cpp.o
[ 50%] Linking CXX shared library libggml-cpu.so
[ 50%] Built target ggml-cpu
[ 53%] Building CXX object ggml/src/CMakeFiles/ggml.dir/ggml-backend-reg.cpp.o
[ 56%] Linking CXX shared library libggml.so
[ 56%] Built target ggml
[ 59%] Building CXX object src/CMakeFiles/whisper.dir/whisper.cpp.o
[ 62%] Linking CXX shared library libwhisper.so
[ 62%] Built target whisper
[ 65%] Building CXX object examples/CMakeFiles/common.dir/common.cpp.o
[ 68%] Building CXX object examples/CMakeFiles/common.dir/common-ggml.cpp.o
[ 71%] Building CXX object examples/CMakeFiles/common.dir/grammar-parser.cpp.o
[ 75%] Linking CXX static library libcommon.a
[ 75%] Built target common
[ 78%] Building CXX object examples/main/CMakeFiles/main.dir/main.cpp.o
[ 81%] Linking CXX executable ../../bin/main
../../ggml/src/libggml.so: undefined reference to std::filesystem::__cxx11::directory_iterator::operator*() const' ../../ggml/src/libggml.so: undefined reference to std::filesystem::__cxx11::path::_M_find_extension() const'
../../ggml/src/libggml.so: undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)' ../../ggml/src/libggml.so: undefined reference to std::filesystem::__cxx11::path::_M_split_cmpts()'
../../ggml/src/libggml.so: undefined reference to std::filesystem::__cxx11::directory_iterator::operator++()' ../../ggml/src/libggml.so: undefined reference to std::filesystem::__cxx11::directory_iterator::directory_iterator(std::filesystem::__cxx11::path const&, std::filesystem::directory_options, std::error_code*)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [examples/main/CMakeFiles/main.dir/build.make:102: bin/main] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:381: examples/main/CMakeFiles/main.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

@bradmit bradmit changed the title Issues Building CPU - CMake Issues Building CPU/Specific GPU - CMake Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant