[GH-ISSUE #959] ./setup.sh fails on Gentoo Linux #418

Closed
opened 2026-11-04 01:42:53 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @kyeno on GitHub (Oct 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/959

The default ./setup.sh approach fails on Gentoo Linux (profile: default/linux/amd64/23.0/desktop/gnome/systemd), no matter how you specify, export or even symlink CUDA_PATH, CUDACXX or LD_LIBRARY_PATH.

The only way to truly build Strata is:

./setup.sh
let it fail
rm -rf build

   /usr/bin/cmake -G Ninja \
  -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja \
  -S . -B build \
  -DCMAKE_BUILD_TYPE=Release \
  -DSTRATA_ENABLE_CUDA=ON \
  -DSTRATA_BUILD_TESTS=OFF \
  -DCMAKE_CUDA_ARCHITECTURES=86 \
  -DCMAKE_CUDA_COMPILER=/opt/cuda/bin/nvcc \
  -DSTRATA_GGML_DIR=./third_party/llama.cpp

ninja -C build
./setup.sh

tl;dr, Gentoo by default installs CUDA in /opt/cuda/ and may not properly propagate LD_LIBRARY_PATH.
Setup scripts in Strata should be aware of this.

Originally created by @kyeno on GitHub (Oct 5, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/959 The default `./setup.sh` approach fails on Gentoo Linux (profile: `default/linux/amd64/23.0/desktop/gnome/systemd`), no matter how you specify, export or even symlink `CUDA_PATH`, `CUDACXX` or `LD_LIBRARY_PATH`. The only way to truly build Strata is: `./setup.sh` let it fail `rm -rf build` ``` /usr/bin/cmake -G Ninja \ -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja \ -S . -B build \ -DCMAKE_BUILD_TYPE=Release \ -DSTRATA_ENABLE_CUDA=ON \ -DSTRATA_BUILD_TESTS=OFF \ -DCMAKE_CUDA_ARCHITECTURES=86 \ -DCMAKE_CUDA_COMPILER=/opt/cuda/bin/nvcc \ -DSTRATA_GGML_DIR=./third_party/llama.cpp ``` `ninja -C build` `./setup.sh` tl;dr, Gentoo by default installs CUDA in `/opt/cuda/` and may not properly propagate `LD_LIBRARY_PATH`. Setup scripts in Strata should be aware of this.
Author
Owner

@kyeno commented on GitHub (Oct 5, 2026):

I have accidentally passed in my 86 architecture there (RTX 3090). You may want to remove it while building yourself.

<!-- gh-comment-id:5998550859 --> @kyeno commented on GitHub (Oct 5, 2026): I have accidentally passed in my 86 architecture there (RTX 3090). You may want to remove it while building yourself.
Author
Owner

@Niko1221 commented on GitHub (Oct 6, 2026):

Thanks for the details. setup already finds nvcc in /opt/cuda*. The failure itself is not in the report: please paste the first error from ./setup.sh (the cmake output, not the last line). If cmake picks a host gcc newer than CUDA supports, CUDAHOSTCXX=/usr/bin/g++-<N> is the usual Gentoo fix, and setup can say so once we see the message.

<!-- gh-comment-id:6010949812 --> @Niko1221 commented on GitHub (Oct 6, 2026): Thanks for the details. setup already finds nvcc in /opt/cuda*. The failure itself is not in the report: please paste the first error from `./setup.sh` (the cmake output, not the last line). If cmake picks a host gcc newer than CUDA supports, `CUDAHOSTCXX=/usr/bin/g++-<N>` is the usual Gentoo fix, and setup can say so once we see the message.
Author
Owner

@kyeno commented on GitHub (Oct 7, 2026):

Hey! I'm aware about "too new GCC" issue on Gentoo vs what CUDA wants, but I also "clamped down" my GCC quite a while back exactly for that reason:

$ gcc --version|head -1
gcc (Gentoo 14.3.1_p20260604 p6) 14.3.1 20260604

$ grep gcc -r /etc/portage/package.mask/
/etc/portage/package.mask/gcc.conf:>=sys-devel/gcc-15.0.0

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2026 NVIDIA Corporation
Built on Mon_Aug_03_13:24:11_PDT_2026
Cuda compilation tools, release 13.4, V13.4.59
Build cuda_13.4.r13.4/compiler.38657139_0

$ nvidia-smi |head -3|tail -1
| NVIDIA-SMI 595.91.07              Driver Version: 595.91.07      CUDA Version: 13.2

I just pulled the newest, clean source of Strata to test it again:

=== Step 4: the Strata engine ===
  llama.cpp source:    33.6 MB   
  [ok] llama.cpp source downloaded
  [ok] llama.cpp 3cf0325 (gguf-py, ggml, mtmd)
  No ready-made engine for v0.1.40 (HTTP Error 404: Not Found): the latest release instead
  [!]  no ready-made engine at https://github.com/Niko1221/Strata/releases/latest/download/ (HTTP Error 404: Not Found): compiling instead
  [ok] build tools present (CUDA 13.4)
  Compiling the Strata engine for your GPU (10-20 minutes, once) ...
  > /usr/bin/cmake -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja -S /home/kyeno/AI/processors/Strata -B /home/kyeno/AI/processors/Strata/build -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_CUDA=ON -DSTRATA_BUILD_TESTS=OFF -DCMAKE_CUDA_ARCHITECTURES=86 -DCMAKE_CUDA_COMPILER=/usr/bin/nvcc -DSTRATA_GGML_DIR=/home/kyeno/AI/processors/Strata/third_party/llama.cpp
-- The CXX compiler identification is GNU 14.3.1
-- 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
CMake Error at /usr/share/cmake/Modules/Internal/CMakeCUDAFindToolkit.cmake:148 (message):
  Couldn't find CUDA library root.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CMakeDetermineCUDACompiler.cmake:109 (cmake_cuda_find_toolkit)
  CMakeLists.txt:147 (enable_language)


-- Configuring incomplete, errors occurred!

  [X]  command failed (exit 1): cmake

Then with your proposed fix - sadly nothing changes. I tried gcc-14 and gcc-12 (left both on this system).

My "fix" still works.

<!-- gh-comment-id:6034420297 --> @kyeno commented on GitHub (Oct 7, 2026): Hey! I'm aware about "too new GCC" issue on Gentoo vs what CUDA wants, but I also "clamped down" my GCC quite a while back exactly for that reason: ``` $ gcc --version|head -1 gcc (Gentoo 14.3.1_p20260604 p6) 14.3.1 20260604 $ grep gcc -r /etc/portage/package.mask/ /etc/portage/package.mask/gcc.conf:>=sys-devel/gcc-15.0.0 $ nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2026 NVIDIA Corporation Built on Mon_Aug_03_13:24:11_PDT_2026 Cuda compilation tools, release 13.4, V13.4.59 Build cuda_13.4.r13.4/compiler.38657139_0 $ nvidia-smi |head -3|tail -1 | NVIDIA-SMI 595.91.07 Driver Version: 595.91.07 CUDA Version: 13.2 ``` I just pulled the newest, clean source of Strata to test it again: ``` === Step 4: the Strata engine === llama.cpp source: 33.6 MB [ok] llama.cpp source downloaded [ok] llama.cpp 3cf0325 (gguf-py, ggml, mtmd) No ready-made engine for v0.1.40 (HTTP Error 404: Not Found): the latest release instead [!] no ready-made engine at https://github.com/Niko1221/Strata/releases/latest/download/ (HTTP Error 404: Not Found): compiling instead [ok] build tools present (CUDA 13.4) Compiling the Strata engine for your GPU (10-20 minutes, once) ... > /usr/bin/cmake -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja -S /home/kyeno/AI/processors/Strata -B /home/kyeno/AI/processors/Strata/build -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_CUDA=ON -DSTRATA_BUILD_TESTS=OFF -DCMAKE_CUDA_ARCHITECTURES=86 -DCMAKE_CUDA_COMPILER=/usr/bin/nvcc -DSTRATA_GGML_DIR=/home/kyeno/AI/processors/Strata/third_party/llama.cpp -- The CXX compiler identification is GNU 14.3.1 -- 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 CMake Error at /usr/share/cmake/Modules/Internal/CMakeCUDAFindToolkit.cmake:148 (message): Couldn't find CUDA library root. Call Stack (most recent call first): /usr/share/cmake/Modules/CMakeDetermineCUDACompiler.cmake:109 (cmake_cuda_find_toolkit) CMakeLists.txt:147 (enable_language) -- Configuring incomplete, errors occurred! [X] command failed (exit 1): cmake ``` Then with your proposed fix - sadly nothing changes. I tried gcc-14 and gcc-12 (left both on this system). My "fix" still works.
Author
Owner

@kyeno commented on GitHub (Oct 7, 2026):

Maybe this will shed some extra light on it for you:

$ /usr/bin/cmake -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja -S . -B build -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_CUDA=ON -DSTRATA_BUILD_TESTS=OFF -DCMAKE_CUDA_ARCHITECTURES=86 -DCMAKE_CUDA_COMPILER=/opt/cuda/bin/nvcc -DSTRATA_GGML_DIR=./third_party/llama.cpp
-- The CXX compiler identification is GNU 14.3.1
-- 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
-- The CUDA compiler identification is NVIDIA 13.4.59 with host compiler GNU 14.3.1
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /opt/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found CUDAToolkit: /opt/cuda/targets/x86_64-linux/include;/opt/cuda/targets/x86_64-linux/include/cccl (found version "13.4.59")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Strata: CUDA enabled, arch 86
-- strata: pack/full/experts.bin absent - the expert arena load test is NOT registered
-- Performing Test STRATA_HAVE_AVXVNNI_INTRINSICS
-- Performing Test STRATA_HAVE_AVXVNNI_INTRINSICS - Success
-- The C compiler identification is GNU 14.3.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- ccache found, compilation results will be cached. Disable with GGML_CCACHE=OFF.
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- GGML_SYSTEM_ARCH: x86
-- Including CPU backend
-- x86 detected
-- Adding CPU backend variant ggml-cpu: -march=native 
-- ggml version: 0.24.0
-- ggml commit:  82f46a8
-- Configuring done (3.0s)
-- Generating done (0.1s)
-- Build files have been written to: /home/kyeno/AI/processors/Strata/build
<!-- gh-comment-id:6034514555 --> @kyeno commented on GitHub (Oct 7, 2026): Maybe this will shed some extra light on it for you: ``` $ /usr/bin/cmake -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja -S . -B build -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_CUDA=ON -DSTRATA_BUILD_TESTS=OFF -DCMAKE_CUDA_ARCHITECTURES=86 -DCMAKE_CUDA_COMPILER=/opt/cuda/bin/nvcc -DSTRATA_GGML_DIR=./third_party/llama.cpp -- The CXX compiler identification is GNU 14.3.1 -- 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 -- The CUDA compiler identification is NVIDIA 13.4.59 with host compiler GNU 14.3.1 -- Detecting CUDA compiler ABI info -- Detecting CUDA compiler ABI info - done -- Check for working CUDA compiler: /opt/cuda/bin/nvcc - skipped -- Detecting CUDA compile features -- Detecting CUDA compile features - done -- Found CUDAToolkit: /opt/cuda/targets/x86_64-linux/include;/opt/cuda/targets/x86_64-linux/include/cccl (found version "13.4.59") -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Strata: CUDA enabled, arch 86 -- strata: pack/full/experts.bin absent - the expert arena load test is NOT registered -- Performing Test STRATA_HAVE_AVXVNNI_INTRINSICS -- Performing Test STRATA_HAVE_AVXVNNI_INTRINSICS - Success -- The C compiler identification is GNU 14.3.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/cc -- ccache found, compilation results will be cached. Disable with GGML_CCACHE=OFF. -- CMAKE_SYSTEM_PROCESSOR: x86_64 -- GGML_SYSTEM_ARCH: x86 -- Including CPU backend -- x86 detected -- Adding CPU backend variant ggml-cpu: -march=native -- ggml version: 0.24.0 -- ggml commit: 82f46a8 -- Configuring done (3.0s) -- Generating done (0.1s) -- Build files have been written to: /home/kyeno/AI/processors/Strata/build ```
Author
Owner

@Niko1221 commented on GitHub (Oct 7, 2026):

Could you post the first cmake error from setup.sh? On Gentoo it is often the host compiler: try CUDAHOSTCXX with a gcc that your CUDA accepts, and send the output if it still fails.

<!-- gh-comment-id:6037912055 --> @Niko1221 commented on GitHub (Oct 7, 2026): Could you post the first cmake error from setup.sh? On Gentoo it is often the host compiler: try CUDAHOSTCXX with a gcc that your CUDA accepts, and send the output if it still fails.
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6155997814 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#418
No description provided.