Skip to content

JavaScript SDK: Segfault on catalog.getModel() on Linux (WSL2) #626

@pdebruin

Description

@pdebruin

Description

catalog.getModel() causes a segmentation fault on Linux (Ubuntu 24.04 under WSL2). The native core library loads and initializes successfully, and downloadAndRegisterEps() completes without issue, but calling catalog.getModel('qwen2.5-0.5b') crashes with a segfault.

Repro steps

  1. On Ubuntu 24.04 (WSL2, Windows 11):
mkdir test && cd test
npm init -y
# Remove foundry-local-sdk-winml from optionalDependencies if present (blocks Linux binary download)
npm install foundry-local-sdk
  1. Run this minimal script:
import { FoundryLocalManager } from 'foundry-local-sdk';

const manager = FoundryLocalManager.create({ appName: 'test', logLevel: 'trace' });
await manager.downloadAndRegisterEps(() => {}); // OK
console.log('EPs done');

const model = await manager.catalog.getModel('qwen2.5-0.5b'); // Segfault here
  1. Output:
EPs done
Getting model...
Segmentation fault (core dumped)

Environment

  • OS: Ubuntu 24.04.2 LTS on WSL2 (Windows 11)
  • Hardware: Intel i7-11370H, NVIDIA RTX A2000 Laptop (4 GB), 16 GB RAM
  • Node.js: v22.22.1
  • foundry-local-sdk: 1.0.0
  • CUDA: 12.8 (driver 573.71)

Notes

  • The native library Microsoft.AI.Foundry.Local.Core.so loads successfully via koffi
  • FoundryLocalManager.create() and downloadAndRegisterEps() both work
  • Crash only occurs when querying the catalog
  • The foundry-local-sdk-winml optional dependency must be removed from package.json for the Linux native binaries to download (the install script skips when winml is detected)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions