Skip to content

[Bug] Illegal Instruction Crash on Windows due to Missing AVX2 CPU Support (Baseline Binary Fails) #31154

Description

@CodeByPartho

Describe the bug:
When running opencode on a Windows machine with an older CPU that does not support AVX2 instructions, the application crashes immediately with an "Illegal instruction" error. This happens even when the installer or binary detection attempts to use the "baseline" build intended for older CPUs. The baseline Windows binary appears to still contain AVX2 instructions or fails to initialize properly, causing the same crash.

To reproduce:

  1. Use a Windows PC with an older Intel CPU (e.g., 5th Gen Broadwell, or any CPU without AVX2 support).
  2. Install opencode globally: npm install -g opencode-ai@latest
  3. Run any opencode command, for example: opencode --version
  4. Observe the crash with the error shown below.

Expected behavior:
OpenCode should run correctly on Windows using a truly compatible baseline binary that does not require AVX2 instructions. Alternatively, it should provide a clear error message explaining the CPU requirement upfront, or gracefully fall back to a pure software mode.

Error logs:
Bun v1.3.6 Windows x64 (baseline)
Features: no_avx2 no_avx
CPU lacks AVX support. Please consider upgrading to a newer CPU.
panic(main thread): Illegal instruction at address 0x7FF7752F90E9
H.loadWebAssemblyModule error: ... (additional errors follow)

Environment:

  • OS: Windows 10 / Windows 11
  • CPU: Intel Core i5-5xxx (Broadwell) / any CPU without AVX2
  • OpenCode version: latest (tried with @latest, also attempted downgrading to 1.10.0, 1.14.0, 1.14.51 – none worked)
  • Installation method: npm install -g opencode-ai

Additional context:
This issue appears related to the binary selection logic on Windows documented in GitHub issues #8744 and #8611. The community workaround using OPENCODE_BIN_PATH environment variable is mentioned but not reliable for all systems and versions. The "baseline" Windows build does not currently provide a fully functional binary without AVX2 dependencies. Many users with older CPUs are blocked from using opencode as a result.

Steps already tried:

  • Uninstalling and reinstalling via npm
  • Downgrading to multiple older versions (1.10.0, 1.14.0, 1.14.51)
  • Cleaning configuration folders (%USERPROFILE%.config\opencode, %LOCALAPPDATA%\opencode)
  • Running as Administrator
  • Using WSL (works as a workaround, but native Windows support is requested)

Request:
Please provide a properly compiled Windows baseline binary that does not require AVX2 instructions, or update the detection logic to ensure a truly compatible binary is selected for older CPUs.

Metadata

Metadata

Assignees

Labels

needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions