CUDA_ARCHITECTURES is set to "native", but no NVIDIA GPU was detected
15:37 21 Jan 2026

I am trying to install llama-cpp-python with GPU support. I installed Nvidia CUDA Toolkit v13.1, nvidia-smi shows that my graphics card - Geforce GTX 1050 Ti - supports CUDA v13, nvcc is installed correctly.

Before calling pip I set some environment Bash variables:

set CMAKE_ARGS=-DGGML_CUDA=ON -DCUDAToolkit_ROOT="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.1" -DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.1" -DCMAKE_CUDA_COMPILER="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.1/bin/nvcc.exe" -DGGML_CCACHE=OFF -DCMAKE_CUDA_FLAGS="-gencode arch=native"

Here's what pip shows me:

Building wheels for collected packages: llama-cpp-python
  Building wheel for llama-cpp-python (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for llama-cpp-python (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [83 lines of output]
      *** scikit-build-core 0.11.6 using CMake 4.2.1 (wheel)
      *** Configuring CMake...
      loading initial cache file C:\Users\mymri\AppData\Local\Temp\tmphor_t73c\build\CMakeInit.txt
      -- Building for: Visual Studio 17 2022
      -- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.19045.
      -- The C compiler identification is MSVC 19.37.32824.0
      -- The CXX compiler identification is MSVC 19.37.32824.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: E:/Visual Studio/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - 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: E:/Visual Studio/VC/Tools/MSVC/14.37.32822/bin/Hostx64/x64/cl.exe - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      CMAKE_BUILD_TYPE=
      -- Could NOT find Git (missing: GIT_EXECUTABLE)
      CMake Warning at vendor/llama.cpp/cmake/build-info.cmake:14 (message):
        Git not found.  Build info will not be accurate.
      Call Stack (most recent call first):
        vendor/llama.cpp/CMakeLists.txt:91 (include)


      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
      -- 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 - not found
      -- Found Threads: TRUE
      -- CMAKE_SYSTEM_PROCESSOR: AMD64
      -- CMAKE_GENERATOR_PLATFORM: x64
      -- GGML_SYSTEM_ARCH: x86
      -- Including CPU backend
      -- Found OpenMP_C: -openmp (found version "2.0")
      -- Found OpenMP_CXX: -openmp (found version "2.0")
      -- Found OpenMP: TRUE (found version "2.0")
      -- x86 detected
      -- Performing Test HAS_AVX_1
      -- Performing Test HAS_AVX_1 - Success
      -- Performing Test HAS_AVX2_1
      -- Performing Test HAS_AVX2_1 - Success
      -- Performing Test HAS_FMA_1
      -- Performing Test HAS_FMA_1 - Success
      -- Performing Test HAS_AVX512_1
      -- Performing Test HAS_AVX512_1 - Failed
      -- Performing Test HAS_AVX512_2
      -- Performing Test HAS_AVX512_2 - Failed
      -- Adding CPU backend variant ggml-cpu: /arch:AVX2 GGML_AVX2;GGML_FMA;GGML_F16C
      -- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.1/include (found version "13.1.115")
      -- CUDA Toolkit found
      -- Using CUDA architectures: native
      -- The CUDA compiler identification is NVIDIA 13.1.115 with host compiler MSVC 19.37.32824.0
      -- Detecting CUDA compiler ABI info
      -- Detecting CUDA compiler ABI info - failed
      -- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.1/bin/nvcc.exe
      CMake Error in C:/Users/mymri/AppData/Local/Temp/tmphor_t73c/build/CMakeFiles/CMakeScratch/TryCompile-x22w2l/CMakeLists.txt:
        CUDA_ARCHITECTURES is set to "native", but no NVIDIA GPU was detected.


      CMake Error in C:/Users/mymri/AppData/Local/Temp/tmphor_t73c/build/CMakeFiles/CMakeScratch/TryCompile-x22w2l/CMakeLists.txt:
        CUDA_ARCHITECTURES is set to "native", but no NVIDIA GPU was detected.


      CMake Error in C:/Users/mymri/AppData/Local/Temp/tmphor_t73c/build/CMakeFiles/CMakeScratch/TryCompile-x22w2l/CMakeLists.txt:
        CUDA_ARCHITECTURES is set to "native", but no NVIDIA GPU was detected.


      CMake Error in C:/Users/mymri/AppData/Local/Temp/tmphor_t73c/build/CMakeFiles/CMakeScratch/TryCompile-x22w2l/CMakeLists.txt:
        CUDA_ARCHITECTURES is set to "native", but no NVIDIA GPU was detected.


      CMake Error at C:/Users/mymri/AppData/Local/Temp/pip-build-env-ea4z0pyf/normal/Lib/site-packages/cmake/data/share/cmake-4.2/Modules/CMakeTestCUDACompiler.cmake:48 (try_compile):
        Failed to generate test project build system.
      Call Stack (most recent call first):
        vendor/llama.cpp/ggml/src/ggml-cuda/CMakeLists.txt:43 (enable_language)


      -- Configuring incomplete, errors occurred!

      *** CMake configuration failed
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for llama-cpp-python
Failed to build llama-cpp-python

I should mention that I tried to change -arch parameter to all, compute_61 etc.

python cuda gpu ml llama