I'm trying to build llama.cpp from source on an Ubuntu 22.04 LTS system. I have an NVIDIA GPU with CUDA and drivers installed. When I run cmake -B build -DGGML_CUDA=ON, it fails. The tail of the output looks as follows:
code
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
-- Including CPU backend
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- x86 detected
-- Adding CPU backend variant ggml-cpu: -march=native
-- Found CUDAToolkit: /usr/local/cuda/include (found version "12.4.131")
-- CUDA Toolkit found
-- Using CUDA architectures: 50-virtual;61-virtual;70-virtual;75-virtual;80-virtual;86-real;89-real
-- The CUDA compiler identification is NVIDIA 12.4.131
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- CUDA host compiler is GNU 11.4.0
-- Including CUDA backend
-- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
CMake Error at common/CMakeLists.txt:85 (message):
Could NOT find CURL. Hint: to disable this feature, set -DLLAMA_CURL=OFF
-- Configuring incomplete, errors occurred!
See also "/home/csa/llama.cpp/build/CMakeFiles/CMakeOutput.log".
I don't see anything particularly relevant in CMakeOutput.log (although I might be missing something). Does this look like a common failure? How should I proceed?
Assistant
This is a common issue when building llama.cpp. The error is straightforward - CMake can't find the CURL library, which llama.cpp uses for certain networking features.
Option 2: Disable CURL support
If you don't need the networking features that require CURL, you can disable it:
bash
cmake -B build -DGGML_CUDA=ON -DLLAMA_CURL=OFF
I'd recommend Option 1 since the CURL features can be useful (they're used for downloading models and other network operations). The libcurl4-openssl-dev package provides the headers and libraries that CMake is looking for.
After resolving the CURL issue, your CUDA configuration looks good - CMake successfully found your CUDA toolkit (version 12.4.131) and detected the appropriate GPU architectures, so you should be all set to build with GPU support once this dependency is resolved.