[GH-ISSUE #220] Linux sm_120: engine built with CUDA 12.8 crashes in MTP prefill (illegal memory access); CUDA 13.0 build works #117

Closed
opened 2026-11-04 01:40:06 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @bobvious on GitHub (Sep 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/220

Environment: Ubuntu 24.04, RTX PRO 5000 Blackwell 48 GB (sm_120), driver 595.91, engine 0.1.27 (a790805), IQ3_S, --max-context 262144, --vision gpu, 250 GB RAM, CPU without AVX-512.

There is no Linux prebuilt (every release ships only strata-windows-x64.zip), so setup compiled the engine. The host toolkit was CUDA 12.8, which install_build_tools accepts for sm_120 (need_cuda = (12, 8), setup.py:951), so setup built with it without asking for 13.0.

Symptom: a short request works (28-token prompt, 117 tok/s). Any prompt of a few thousand tokens kills the engine:

prefill copy_i32: an illegal memory access was encountered

That is the MTP drafter's prefill capture (src/core/mtp.cpp:516, copy_i32_from_mapped). It is deterministic. Things that did NOT change it:

  • --prefill 2048 (auto had picked 8192 on the 48 GB card)
  • --max-context 131072
  • --vram-reserve-mib 700 -> 1200 (auto sizing had left 194 MiB free, see #199)

The same model and version run fine on Windows with the release build (CUDA 13.0).

Fix that worked: build the same source with CUDA 13.0 (inside nvidia/cuda:13.0.2-devel-ubuntu24.04, same cmake defs as setup.py:1076-1085), and use the CUDA_WHEELS from setup.py for the runtime. Now a 17,104-token prompt prefills at 2,473 tok/s and decodes at 98 tok/s.

Two smaller things we hit on the way:

  1. lib_dirs from the run config is applied to the engine's environment only (serve/server.py:499), not to strata-vision. A vision helper built against CUDA 13 then fails with the vision encoder did not start because it can't find libcudart.so.13, libcublas.so.13 or libnccl.so.2. We worked around it with LD_LIBRARY_PATH in our launcher, plus pip install nvidia-nccl-cu13.
  2. The generated run-*.sh doesn't keep --gpu unless you also pass --setup. On a two-GPU box that means the engine can land on the wrong card.

Suggestions: require 13.0 on Linux sm_120 (or warn loudly when building with 12.x), or publish a strata-linux-x64.zip.

Thanks for the engine, the numbers are impressive.

Originally created by @bobvious on GitHub (Sep 30, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/220 Environment: Ubuntu 24.04, RTX PRO 5000 Blackwell 48 GB (sm_120), driver 595.91, engine 0.1.27 (a790805), IQ3_S, `--max-context 262144`, `--vision gpu`, 250 GB RAM, CPU without AVX-512. There is no Linux prebuilt (every release ships only `strata-windows-x64.zip`), so setup compiled the engine. The host toolkit was CUDA 12.8, which `install_build_tools` accepts for sm_120 (`need_cuda = (12, 8)`, setup.py:951), so setup built with it without asking for 13.0. **Symptom:** a short request works (28-token prompt, 117 tok/s). Any prompt of a few thousand tokens kills the engine: ``` prefill copy_i32: an illegal memory access was encountered ``` That is the MTP drafter's prefill capture (`src/core/mtp.cpp:516`, `copy_i32_from_mapped`). It is deterministic. Things that did NOT change it: - `--prefill 2048` (auto had picked 8192 on the 48 GB card) - `--max-context 131072` - `--vram-reserve-mib` 700 -> 1200 (auto sizing had left 194 MiB free, see #199) The same model and version run fine on Windows with the release build (CUDA 13.0). **Fix that worked:** build the same source with CUDA 13.0 (inside `nvidia/cuda:13.0.2-devel-ubuntu24.04`, same cmake defs as setup.py:1076-1085), and use the `CUDA_WHEELS` from setup.py for the runtime. Now a 17,104-token prompt prefills at 2,473 tok/s and decodes at 98 tok/s. **Two smaller things we hit on the way:** 1. `lib_dirs` from the run config is applied to the engine's environment only (serve/server.py:499), not to `strata-vision`. A vision helper built against CUDA 13 then fails with `the vision encoder did not start` because it can't find `libcudart.so.13`, `libcublas.so.13` or `libnccl.so.2`. We worked around it with `LD_LIBRARY_PATH` in our launcher, plus `pip install nvidia-nccl-cu13`. 2. The generated `run-*.sh` doesn't keep `--gpu` unless you also pass `--setup`. On a two-GPU box that means the engine can land on the wrong card. **Suggestions:** require 13.0 on Linux sm_120 (or warn loudly when building with 12.x), or publish a `strata-linux-x64.zip`. Thanks for the engine, the numbers are impressive.
Author
Owner

@Niko1221 commented on GitHub (Sep 30, 2026):

Thanks for the detailed report. 0.1.28 (in testing) requires CUDA 13.0 for RTX 50 / sm_120 builds. The copy_i32 error comes from the main prompt path, not the MTP capture, and CUDA errors surface late. If you can, run the 12.8 build once under compute-sanitizer --tool memcheck so we can see the first bad access. The vision lib_dirs point: the server passes the config's environment to the encoder as well; the failure came from mixing a CUDA 13 encoder with a 12.8 engine config. To keep a card choice, pass --gpu N with --setup, or use --gpus N.

<!-- gh-comment-id:5908108813 --> @Niko1221 commented on GitHub (Sep 30, 2026): Thanks for the detailed report. 0.1.28 (in testing) requires CUDA 13.0 for RTX 50 / sm_120 builds. The `copy_i32` error comes from the main prompt path, not the MTP capture, and CUDA errors surface late. If you can, run the 12.8 build once under `compute-sanitizer --tool memcheck` so we can see the first bad access. The vision `lib_dirs` point: the server passes the config's environment to the encoder as well; the failure came from mixing a CUDA 13 encoder with a 12.8 engine config. To keep a card choice, pass `--gpu N` with `--setup`, or use `--gpus N`.
Author
Owner

@Niko1221 commented on GitHub (Sep 30, 2026):

0.1.28 requires CUDA 13.0 for RTX 50 / sm_120 builds, so setup won't build with 12.8 there. Closing; if you get a compute-sanitizer trace of the 12.8 crash, please post it here and reopen.

<!-- gh-comment-id:5908633730 --> @Niko1221 commented on GitHub (Sep 30, 2026): [0.1.28](https://github.com/Niko1221/Strata/releases/tag/v0.1.28) requires CUDA 13.0 for RTX 50 / sm_120 builds, so setup won't build with 12.8 there. Closing; if you get a compute-sanitizer trace of the 12.8 crash, please post it here and reopen.
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#117
No description provided.