#6172 [Other] Source build fails when sccache is on PATH: ggml's global RULE_LAUNCH_COMPILE wraps Strata's nvcc compiles

closed · @m-wells · 1 comentários · No GitHub

Setup & installNVIDIA / CUDAModels & quantsWindowsLinux

Descrição

### Area

[Other]  (anything else, including setup and installation)

### Desktop app, Terminal or source?

Source (START-HERE.bat, setup.sh or a build)

### What happened

The source build failed in Strata's own CUDA files when `sccache` was on the PATH (sccache 0.14.0 from `cargo install`; no `ccache` installed). Every nvcc compile was wrapped in sccache and failed at the fatbinary step:

```
FAILED: [code=254] CMakeFiles/strata_core.dir/src/core/device.cu.o
sccache /opt/cuda/bin/nvcc -forward-unknown-to-host-compiler -ccbin=/usr/bin/g++-15 -DSTRATA_HAVE_DFLASH2=1 ...
fatbinary fatal: Could not open input file 'device.ptx'
```

`src/core/pinned.cu.o` failed the same way. I expected the engine to build. It builds once the vendored ggml's compiler launcher is turned off (`-DGGML_CCACHE=OFF`).

Why, from reading the CMake files (unconfirmed static analysis): `third_party/strata-ggml/ggml/CMakeLists.txt` defaults `GGML_CCACHE` to ON, and `third_party/strata-ggml/ggml/src/CMakeLists.txt` (lines 68-84) finds `ccache` or `sccache` and sets `RULE_LAUNCH_COMPILE` as a **GLOBAL** property. A global launcher applies to every target in the build, not only ggml's, so Strata's `.cu` compiles go through sccache as well. setup.py has no way to pass the switch: `engine_defs` adds only `-DSTRATA_EXPERIMENTAL_SM60`.

Possible fixes: setup passes `-DGGML_CCACHE=OFF` when it configures the engine (and the vision build), or the launcher is set per ggml target instead of globally. Not tested: whether plain ccache breaks nvcc the same way.

### Smallest steps or command that reproduce it

1. `sccache` on the PATH, no `ccache`.
2. On v0.2.15: `STRATA_NVCC=/opt/cuda/bin/nvcc CC=/usr/bin/gcc-15 CXX=/usr/bin/g++-15 CUDAHOSTCXX=/usr/bin/g++-15 ./setup.sh --yes --family qwen --model IQ3_XXS --build --vision no --no-start --no-browser` stops with the error above.
3. Workaround that built: configure `build/` once by hand with `cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Release -DGGML_CCACHE=OFF -DCMAKE_CUDA_ARCHITECTURES=89 ...`; setup's later runs reuse that CMake cache.

### Reproduction status

Reproduced locally

### Strata version

v0.2.15 (commit c775728), engine 0.1.61, built from source

### Graphics card, memory and system

RTX 4080 Laptop GPU 12 GB (sm_89), 64 GB DDR5, Arch Linux (kernel 7.2), CUDA 13.4 (V13.4.92), GCC 15.3, Ninja, sccache 0.14.0

### Model, size and settings

Not model-specific (it is the engine build).

No site

Links install, modelos, releases.