Skip to content

Instantly share code, notes, and snippets.

@rodjjo
Created November 2, 2025 19:29
Show Gist options
  • Select an option

  • Save rodjjo/408532d917160ff1134e82e22009ce06 to your computer and use it in GitHub Desktop.

Select an option

Save rodjjo/408532d917160ff1134e82e22009ce06 to your computer and use it in GitHub Desktop.
Install llama cpp python with cuda support in ubuntu 22.04
#!/bin/sh
export CC=/usr/bin/gcc CXX=/usr/bin/g++ CUDA_PATH=/usr/local/cuda CUDACXX=/usr/local/cuda/bin/nvcc
export LD_LIBRARY_PATH=/usr/lib/gcc/$(gcc -dumpmachine)/$(gcc -dumpversion):$LD_LIBRARY_PATH
CMAKE_ARGS="-DGGML_CUDA=on \
-DLLAMA_BUILD_EXAMPLES=OFF \
-DLLAMA_BUILD_TESTS=OFF" FORCE_CMAKE=1 CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \
pip install llama-cpp-python==0.3.9 --no-cache-dir --force-reinstall --upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment