Skip to content

Add native Windows builds, WGL rendering, and ABI-checked Python bindings - #17

Open
reymondmeking-dot wants to merge 2 commits into
AmmarkoV:mainfrom
reymondmeking-dot:codex/windows-native-support
Open

Add native Windows builds, WGL rendering, and ABI-checked Python bindings#17
reymondmeking-dot wants to merge 2 commits into
AmmarkoV:mainfrom
reymondmeking-dot:codex/windows-native-support

Conversation

@reymondmeking-dot

@reymondmeking-dot reymondmeking-dot commented Sep 9, 2026

Copy link
Copy Markdown

The native Windows build currently stops at POSIX threading, GLX, MSVC C compatibility, ONNX Runtime path types and DLL loading. This adds an MSVC x64 build for the inference CLI, C/Python DLL, offline BVH extractor and Win32/WGL viewer, with a PowerShell build/model-download path and Windows CI.

The WGL backend is adapted from beemsoft's work in #13, with attribution retained in the source and Windows guide. This contribution applies that approach to the current pipeline and covers the current CLI, threading, ABI and runtime dependency requirements.

Changes

  • Add native Windows worker-pool and C compatibility code, Unicode-aware ORT session paths, Windows model discovery, DLL exports and runtime DLL staging. Keep Linux GLX and POSIX paths conditional.
  • Add a WGL OpenGL 3.3 viewer with hidden rendering, window events and checked teardown. Keep offline extraction available without a GL context.
  • Separate GPU ONNX Runtime selection from the optional nvcc toolchain: an NVIDIA runtime installation can run ORT CUDA inference while native ggml/LBS remains on CPU. Keep CPU/GPU ORT download caches separate and support MSVC Debug compilation flags.
  • Add explicit --decoder model selection alongside --backbone, including the smaller FP16 graphs on the CUDA execution provider.
  • Consolidate five Python ctypes declarations into a shared binding. Match the current detector and skeleton fields, validate C ABI version/structure sizes, and reject stale libraries before inference.
  • Add a PowerShell downloader that reads the existing Bash manifest, verifies file size/SHA256, resumes partial files and observes SAM3D_AUTO_FETCH.
  • Add Windows build instructions, a local validation record and a model-free Windows Actions workflow.

Validation

Local Windows 11 x64, VS 2022/MSVC 14.44, OpenCV 4.10, GLEW 2.2, ORT 1.20.1 GPU, RTX 4060 Laptop 8 GB:

  • Full native Release build through Windows PowerShell 5.1; 12/12 CTest checks passed with the WGL test enabled. These include actual DLL ABI/lifecycle, C structure layouts, worker-pool concurrency, shader draw/pixel readback, CLI help and multiview utility checks.
  • PowerShell downloader: 17 offline checks; actual nine-file FP16 model profile downloaded and SHA256-verified.
  • Actual CUDA inference on the upstream SAM 3D Body dancing image, finite keypoints/CSV/BVH, and a native WGL mesh overlay saved and visually inspected.
  • Offline 16-frame video excerpt: two tracks exported to BVH with 16 and 10 frames, all 498 channels per frame present and finite.
  • Actual ctypes inference: two-person output and capacity-one truncation, finite 127-joint skeletons and intact result-buffer sentinels.
  • ORT JSON profiles confirm CUDA execution events in backbone, decoder and detector sessions, with some CPU nodes.
  • Workflow syntax checked with actionlint 1.7.12.
  • Hosted Windows CI passed for ab376f5: Windows native build. A clean windows-2022 runner downloaded CPU ORT 1.20.1, built all native targets including the viewer, passed 11/11 CTest checks, and passed the 17 PowerShell downloader checks. Hardware WGL execution is tested locally, not on the hosted runner.

See knowledge/WINDOWS_VALIDATION.md for the exact environment, commands, public input sources and limits. No model weights, dependency binaries or test media are included.

Scope

Camera backends, native nvcc compilation, TensorRT, refined models, Blender import, exhaustive non-ASCII paths and Linux runtime regression remain unverified. The repository assets are still required at runtime; this is not a standalone Windows installer. POSIX server/shared-memory/V4L2 and X11-only tools remain outside native Windows support. The new ABI guard requires rebuilding the DLL alongside the updated Python files.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant