The error message you're seeing from CMake when building llama.cpp indicates that it's trying to find the CUDA Toolkit at /usr/local/cuda-12.6, but that path does not exist on your system:
CMake Warning (dev) at /usr/share/cmake-3.31/Modules/FindCUDAToolkit.cmake:1016 (file):
Given path:
/usr/local/cuda-12.6
does not refer to an existing path on disk.
This typically means one of the following:
- CUDA 12.6 is not installed on your system.
- CUDA is installed, but in a different location.
- An environment variable (like CUDA_HOME or CUDAToolkit_ROOT) is incorrectly set to /usr/local/cuda-12.6.
To resolve this:
✅ Step 1: Check if CUDA is installed
Run:
nvcc --version
If this command is not found, CUDA is likely not installed or not in your PATH.
✅ Step 2: Locate your CUDA installation
Try:
ls /usr/local/
Look for directories like cuda, cuda-11.8, cuda-12.2, etc.
✅ Step 3: Set the correct CUDA path
If you find the correct version (e.g., /usr/local/cuda-12.2), you can set the environment variable before running cmake:
export CUDAToolkit_ROOT=/usr/local/cuda-12.2
Or, pass it directly to cmake:
cmake -DCUDAToolkit_ROOT=/usr/local/cuda-12.2 ..
✅ Step 4: If you don’t need CUDA support
If you don’t plan to use GPU acceleration, you can disable CUDA in the build:
cmake -DLLAMA_CUDA=OFF ..
✅ Step 5: Install CUDA 12.6 (if needed)
If you specifically need CUDA 12.6, download and install it from NVIDIA’s website:
https://developer.nvidia.com/cuda-downloads
Then ensure it’s installed to /usr/local/cuda-12.6 or update your environment variables accordingly.
Let me know if you need help installing CUDA or configuring llama.cpp for CPU-only builds.