[GH-ISSUE #2389] Engine fails to start on WSL2 — "native embedding: cannot pin 322 MiB: no #965

Closed
opened 2026-11-04 01:47:22 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @h8an6s on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2389

Environment: Windows host + WSL2 (Ubuntu, kernel 6.18.54.1-microsoft-standard-WSL2), RTX 4090 24GB,
driver 615.78.05 (CUDA UMD 13.4), CUDA toolkit 12.4 (failed build) / 13.3 (resolved build), GCC 15.2, WSL RAM 56GB.

Bug: Engine 0.1.43.1 / 0.1.44.1 source (built with CUDA 12.4) exits before ready on every start:
native embedding: cannot pin 322 MiB: no CUDA-capable device is detected, nor place it in VRAM
at src/core/native_head.cpp:151 — cudaHostAlloc(cudaHostAllocMapped | cudaHostAllocPortable) returns
cudaErrorNoDevice on WSL2; the cudaMalloc+memcpy fallback also fails.

Not a system-level CUDA issue: nvidia-smi OK, /dev/dxg exists, plain CUDA programs return count=1,
cuInit OK, cudaHostAlloc(Mapped|Portable, 322MB) succeeds standalone (single / parallel / threaded).
Vision encoder (GPU build) loads fine. Only the engine start path fails. Direct engine run (bypassing
server.py, with --native) reproduces → not server.py env injection (an earlier hypothesis, ruled out).

Community contrast: bench/results/2026-10-09-community-rtx-5060ti-wsl2-iq3_s-0141/ runs on engine
0.1.41 + CUDA 13.0. Repo also has bench/results/2026-10-07-community-rtx-5080-docker-wsl2 with the
same "no CUDA-capable device" log → not isolated to us.

Resolution (verified locally): update source to latest main 296b59d2 (> v0.1.44.1) + rebuild with
CUDA toolkit 13.3 (13.0 + GCC 15.2 hits mathcalls.h rsqrt noexcept conflict; 13.3 fixes it). Engine
then starts fine: 7,671 expert slots cached, decode ~106 tok/s, long-prompt prefill ~1,357 tok/s.

Suggestions:

  1. The error message is misleading — the device enumerates fine; only cudaHostAlloc(Mapped|Portable)
    fails on WSL2. Print cudaGetErrorString / device count, and detect WSL2 (e.g. /dev/dxg).
  2. Provide a pure host-memory / mmap fallback for native embedding when the WSL2 driver pinned budget
    (~1 GiB, per the author's own comment) is exhausted.
  3. Version-regression suspicion: 0.1.41 works, 0.1.43.1/0.1.44.1 fail — please review native_head /
    embedding init changes between 0.1.42 → 0.1.43.

Note: source version and CUDA build version changed together; single-variable isolation not fully
done, but the combination is stably reproducible.

Originally created by @h8an6s on GitHub (Oct 14, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/2389 Environment: Windows host + WSL2 (Ubuntu, kernel 6.18.54.1-microsoft-standard-WSL2), RTX 4090 24GB, driver 615.78.05 (CUDA UMD 13.4), CUDA toolkit 12.4 (failed build) / 13.3 (resolved build), GCC 15.2, WSL RAM 56GB. Bug: Engine 0.1.43.1 / 0.1.44.1 source (built with CUDA 12.4) exits before ready on every start: native embedding: cannot pin 322 MiB: no CUDA-capable device is detected, nor place it in VRAM at src/core/native_head.cpp:151 — cudaHostAlloc(cudaHostAllocMapped | cudaHostAllocPortable) returns cudaErrorNoDevice on WSL2; the cudaMalloc+memcpy fallback also fails. Not a system-level CUDA issue: nvidia-smi OK, /dev/dxg exists, plain CUDA programs return count=1, cuInit OK, cudaHostAlloc(Mapped|Portable, 322MB) succeeds standalone (single / parallel / threaded). Vision encoder (GPU build) loads fine. Only the engine start path fails. Direct engine run (bypassing server.py, with --native) reproduces → not server.py env injection (an earlier hypothesis, ruled out). Community contrast: bench/results/2026-10-09-community-rtx-5060ti-wsl2-iq3_s-0141/ runs on engine 0.1.41 + CUDA 13.0. Repo also has bench/results/2026-10-07-community-rtx-5080-docker-wsl2 with the same "no CUDA-capable device" log → not isolated to us. Resolution (verified locally): update source to latest main 296b59d2 (> v0.1.44.1) + rebuild with CUDA toolkit 13.3 (13.0 + GCC 15.2 hits mathcalls.h rsqrt noexcept conflict; 13.3 fixes it). Engine then starts fine: 7,671 expert slots cached, decode ~106 tok/s, long-prompt prefill ~1,357 tok/s. Suggestions: 1. The error message is misleading — the device enumerates fine; only cudaHostAlloc(Mapped|Portable) fails on WSL2. Print cudaGetErrorString / device count, and detect WSL2 (e.g. /dev/dxg). 2. Provide a pure host-memory / mmap fallback for native embedding when the WSL2 driver pinned budget (~1 GiB, per the author's own comment) is exhausted. 3. Version-regression suspicion: 0.1.41 works, 0.1.43.1/0.1.44.1 fail — please review native_head / embedding init changes between 0.1.42 → 0.1.43. Note: source version and CUDA build version changed together; single-variable isolation not fully done, but the combination is stably reproducible.
Author
Owner

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

Thanks for taking the time to report this.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6271002804 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for taking the time to report this. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#965
No description provided.