Self-hosted server crashes with SIGILL on x86-64 CPUs without AVX2 (linux-x64 built with bun-linux-x64 instead of -baseline)
Bug report
Environment
- OS: Linux x86-64, Debian-based Kubernetes (k3s) node
- CPU: Intel Xeon E3-1245 v2 (Ivy Bridge: AVX, no AVX2)
- Supermemory: self-hosted server
docker.io/supermemory/supermemory:0.0.9(amd64), also reproduced with 0.0.8 and 0.0.7 - Runtime embedded in the binary:
Bun v1.3.4 (5eb2145b) Linux x64
Steps to reproduce
- On an x86-64 CPU without AVX2, run
docker run --rm supermemory/supermemory:0.0.9, or run the standalonesupermemory-server-linux-x64asset directly. - Alternatively, on any x86-64 machine, run
qemu-x86_64 -cpu IvyBridge ./supermemory-server-linux-x64.
Expected behavior
The server starts and answers /v3/health.
Actual behavior
The process dies within seconds, before opening its port. The standalone binary exits with code 132, and the container goes into CrashLoopBackOff.
Error messages
Illegal instruction
traps: supermemory-ser[...] trap invalid opcode ip:4084550 ...
The disassembly at 0x4084550 shows vinserti128 $0x1,%xmm1,%ymm0,%ymm0, which is an AVX2 instruction.
Analysis
- The binary is a
bun build --compileexecutable. Its first 104,292,808 bytes are byte-identical to the officialbun-linux-x64v1.3.4 runtime, which is the "modern" build and requires AVX2. The faulting address is inside the Bun runtime's.text. - The other native parts look fine: embeddings and PGlite run through WASM, and
rivet-engineis a genericx86_64-unknown-linux-muslbuild. - For a local test only, without redistributing anything, I swapped in the official
bun-linux-x64-baselinev1.3.4 runtime and kept the appended JS payload unchanged. Underqemu-x86_64 -cpu IvyBridge, that binary reports0.0.9, starts, ingests a document through/v3/documents(statusdone, with local embeddings) and answers/v4/searchwith 200.
Feature request
Problem statement
The self-hosted server cannot run on x86-64 CPUs without AVX2, which are still common in homelabs and on older dedicated servers.
Proposed solution
Publish a baseline build: a supermemory-server-linux-x64-baseline release asset built with bun build --compile --target=bun-linux-x64-baseline, and a matching image tag such as 0.0.9-baseline. Optionally, install.sh could check /proc/cpuinfo for avx2 and choose that asset when it is missing.
Alternatives considered
- Build x64 with the baseline target by default. Bun's baseline build still does runtime SIMD dispatch, so the cost is usually small.
- Run the binary under QEMU user-mode emulation. It works, but it costs a lot of CPU and RAM.
- Patch the runtime locally, as described above. Is that acceptable under the lite license as a stopgap?
If this isn't already being handled internally, I can send a PR that adds a supermemory-server-linux-x64-baseline asset built with bun build --compile --target=bun-linux-x64-baseline, plus an avx2 check in install.sh that picks it when the CPU lacks AVX2. I'd verify it the way the report does, under qemu-x86_64 -cpu IvyBridge against /v3/health.