Skip to content

Windows: Installer should detect CPU capabilities and use baseline binary for CPUs without AVX2 #12553

Closed as not planned

Description

@James1095

Problem

OpenCode v1.1.53 hangs on startup on Windows with CPUs that lack AVX2 instructions (e.g., Intel Ivy Bridge, Sandy Bridge, early Haswell).

The opencode-windows-x64 binary requires AVX2, but the installer doesn't detect CPU capabilities. When run on a CPU without AVX2, the binary crashes with "Illegal instruction" before any output.

Environment

  • OpenCode version: 1.1.53
  • Platform: Windows 11 x64
  • CPU: Intel Xeon E3-1230 V2 (Ivy Bridge) - has AVX but not AVX2
  • Installation method: bun install -g opencode-ai

Steps to Reproduce

  1. On a Windows machine with a CPU lacking AVX2 (Ivy Bridge or older)
  2. Run bun install -g opencode-ai
  3. Run opencode
  4. Observe: hangs indefinitely, no output, no error message

Root Cause

The Bun shim at ~/.bun/bin/opencode resolves to opencode-windows-x64/bin/opencode.exe which is compiled with AVX2 instructions. The CPU throws "Illegal instruction" when executing AVX2 opcodes.

The baseline binary (opencode-windows-x64-baseline/bin/opencode.exe) works correctly:

# AVX2 binary - crashes
$ timeout 5 ~/.bun/install/global/node_modules/opencode-windows-x64/bin/opencode.exe --version
# Result: Illegal instruction (exit code 132)

# Baseline binary - works
$ timeout 5 ~/.bun/install/global/node_modules/opencode-windows-x64-baseline/bin/opencode.exe --version
1.1.53

Current Workaround

Manually replace the binary after each install/update:

Copy-Item "$env:USERPROFILE\.bun\install\global\node_modules\opencode-windows-x64-baseline\bin\opencode.exe" "$env:USERPROFILE\.bun\install\global\node_modules\opencode-windows-x64\bin\opencode.exe" -Force

Suggested Fix

The packages/opencode/bin/opencode launcher already supports OPENCODE_BIN_PATH environment variable, but Bun's shim bypasses this script entirely.

Options:

  1. Detect AVX2 at runtime in the launcher and fall back to baseline binary
  2. Use CPUID during postinstall to select the correct binary variant
  3. Document the workaround for users with older CPUs

Related

  • The baseline binary packages are already published (opencode-windows-x64-baseline, opencode-darwin-x64-baseline, etc.)
  • Similar issue may affect Linux/macOS users with older x64 CPUs

Activity

  1. added
    perfIndicates a performance issue or need for optimization
    on Feb 7, 2026
  2. github-actions commented on Feb 7, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    These all report the same underlying problem of OpenCode binaries requiring AVX2 instructions on older CPUs (Ivy Bridge, Sandy Bridge, etc.) and crashing with illegal instruction errors.

    Feel free to ignore if this addresses a different aspect of the issue.

  3. BassemN commented on Feb 8, 2026

    @BassemN

    I am using Ubuntu 20.04.6 LTS. Opencode was running properly on version 1.1.51, but after upgrading to version 1.1.52 or 1.1.53, it no longer runs.

  4. pei55 commented on Feb 9, 2026

    @pei55

    I am using Ubuntu 20.04.6 LTS. Opencode was running properly on version 1.1.51, but after upgrading to version 1.1.52 or 1.1.53, it no longer runs.

    the same to you.

  5. kgorgolewski commented on Mar 28, 2026

    @kgorgolewski

    hi there,

    i am also having issues on the following device. i tried to make a summary with opencode (from another device) what we all tried...
    are there any chance to get opencode compiled/running on such old cpus?

    thanks
    krzysztof

    Device Info:

    • Device: Debian 12
    • CPU: Intel Core2 Quad Q9550 @ 2.83GHz (Yorkfield, 2008)
    • RAM: 5.8GB
      Issue: OpenCode crashes with "Illegal instruction" (SIGILL, exit code 132) because the bundled binary requires AVX instructions, which this CPU doesn't support.

    What we tried:

    1. Downloaded and installed opencode via npm - binary crashes with SIGILL
    2. Verified the binary uses AVX instructions (objdump showed vmovdqa, vmovdqu, etc.)
    3. Tried downloading Linux baseline binary
    4. Attempted to install bun for building from source - bun binaries also require AVX
    5. Tried older bun versions (v0.6.0) - also require AVX
    6. Cloned bun source repo - building requires an existing bun binary for transpilation (circular dependency)

    Conclusion: OpenCode on this hardware requires either a pre-AVX binary release or building bun from scratch with custom CPU flags, which is impractical given the circular dependency and compilation time on this hardware.

    • Bun: Even bun install crashes (JS runtime uses AVX internally)
    • OpenCode: Bundled Bun binary requires AVX to execute
    • Both compiled with LLVM targeting AVX as minimum for x86-64
  6. kgorgolewski commented on Apr 14, 2026

    @kgorgolewski

    FYI i found yesterday crush, which is a followup development from opencode. i switched to it, as there is a fallback to non avx cpu hardware and it looks like working like a charm. so from my pov there is no sense in investing any effort in this issue report ;)

  7. assigned and unassigned on Apr 26, 2026
  8. removed
    perfIndicates a performance issue or need for optimization
    on May 3, 2026
  9. liucc52 commented on May 13, 2026

    @liucc52

    how about the performace of the baseline version, is there any differnce compare with the normal one?

  10. liucc52 commented on May 20, 2026

    @liucc52

    what is the difference between the normal version and baseline version of opencode?

  11. github-actions commented on Jul 19, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions