Skip to content

Windows support, solver choice in the interface, NVIDIA builds - #4

Merged
kylebme merged 2 commits into
workbench-uifrom
feature/windows-gpu-builds
Oct 10, 2026
Merged

kylebme merged 2 commits into
workbench-uifrom
feature/windows-gpu-builds

Conversation

@kylebme

@kylebme kylebme commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Gets the hypre/GPU work from ffc2e80 running on Windows, adds a direct/iterative and CPU/GPU solver choice to the interface, and builds NVIDIA editions of the Windows and Linux apps in CI.

Windows

  • hypre is threaded on Windows. It's compiled with MSVC's /openmp:llvm, so hypre and MKL share LLVM's OpenMP runtime (libomp.dll); before, hypre ran on one thread. On an 856k-equation beam, CPU AMG setup went from 19.1 s to 5.3 s and CG from 54 s to 26 s, so a whole solve takes 62 s, against 114 s for PARDISO.
  • --cuda works on Windows, from a new native/calculix/solver-env-windows-cuda.yml (CUDA 12.9).
  • hypre builds with Ninja on Windows. NMake compiled one file at a time.
  • tests/desktop.mjs now runs on Windows and Linux, not only macOS.

Solver choice in the interface

  • Mesh + Solver offers Direct / Iterative, each the best of its kind on the computer that solves:
    • Direct is PARDISO, else SPOOLES.
    • Iterative is hypre's CG with BoomerAMG, else CalculiX's incomplete Cholesky (macOS).
  • CPU / GPU appears where a GPU build works. It's a per-machine preference like Threads, sent as ?device=gpu, and applies to the iterative solver only.
  • A "Solves with" line names the exact solver, e.g. hypre 3.2.0 CG with BoomerAMG, on the GPU (NVIDIA GeForce RTX 3070).
  • GET /api/solvers reports what's available (worker command solvers, asked once per service).
  • Older studies saved with a specific iterative solver open as Iterative. The service still accepts the old names.

NVIDIA builds

  • build-solver.py --cuda ARCH builds a second helper, solver/sprung-solve-gpu/, beside the CPU one.
    • On a machine without an NVIDIA GPU or driver it still starts, runs PARDISO, and offers no CG.
    • The engine then uses the CPU helper, BoomerAMG included, so the NVIDIA build never loses anything the normal build has.
  • The GPU helper ships much less of NVIDIA's code, with no loss of speed (GPU setup + CG: 4.0 s vs 4.3 s on the 857k-equation beam):
    • CUDA's own memory pool (cudaMallocAsync) on both platforms, replacing Umpire. Umpire was downloaded unpinned and doesn't build with MSVC.
    • No cuBLAS or cuSOLVER (1 GB).
    • The CUDA runtime is linked statically.
    • hypre 3.2.0 doesn't build for CUDA without cuSPARSE or cuRAND, so those ship with nvJitLink (about 620 MB on Windows, down from 1.75 GB).
  • bundle-runtime.py --gpu and npm run package:{win,linux}:nvidia produce Sprung-FEA-Setup-<v>-NVIDIA.exe and Sprung-FEA-<v>-x86_64-NVIDIA.AppImage, with NVIDIA's CUDA EULA (licenses/NVIDIA-CUDA.txt). The normal builds don't change.
  • CI gets two NVIDIA jobs, targeting CUDA architectures 75;86-real;89-real;120-real: Turing with its PTX, Ampere, Ada, Blackwell. The runners have no GPU, so their tests check that the NVIDIA build falls back to CPU BoomerAMG.
    • hypre's CUDA build is cached between runs (--hypre-cache, saved right after the build).
    • The first run will be slow: about 10 minutes on 16 threads locally, so probably 45+ minutes on a 4-core runner.

Testing (Windows 11, RTX 3070)

  • Engine suite (unittest discover): 103 passed
  • Solver tests, including GPU vs CPU and GPU-build-without-GPU: 16 passed, with a GPU
  • JS and server tests: 7 passed
  • Playwright end-to-end, including the GPU test: 37 passed (Edge)
  • package:win and package:win:nvidia, then test:packaged and test:desktop on each: pass. The NVIDIA package solves on the GPU, and with CUDA_VISIBLE_DEVICES=-1 falls back to CPU BoomerAMG. Installers are 208 MB (normal) and 570 MB (NVIDIA)

I couldn't test the Linux NVIDIA job locally; this PR's CI is its first run.

🤖 Generated with Claude Code

kylebme and others added 2 commits October 9, 2026 06:55
Windows:
- hypre threads on Windows: MSVC's /openmp:llvm puts it on LLVM's OpenMP
  runtime with MKL (856k-equation beam: CPU AMG solve 104 s -> 62 s).
- build-solver.py --cuda builds on Windows (solver-env-windows-cuda.yml);
  hypre builds with Ninja there.
- tests/desktop.mjs runs on Windows and Linux too.

Solver choice:
- Studies choose direct or iterative, each the best this computer has
  (PARDISO/SPOOLES; hypre BoomerAMG, else incomplete Cholesky). CPU or
  GPU is a per-machine preference (?device=gpu), offered where a GPU
  build works. GET /api/solvers reports what is available, and the
  Mesh + Solver panel names the solver a choice runs.

NVIDIA builds:
- --cuda builds a second helper, sprung-solve-gpu, beside the CPU one.
  Without an NVIDIA GPU it runs PARDISO alone, and the engine uses the
  CPU helper's BoomerAMG.
- CUDA's own memory pool replaces Umpire (unpinned download, no MSVC
  build); no cuBLAS or cuSOLVER; the CUDA runtime is linked statically.
- bundle-runtime.py --gpu and npm run package:{win,linux}:nvidia make
  the NVIDIA installers, with NVIDIA's CUDA license.
- CI builds the NVIDIA editions for Windows and Linux, caching hypre's
  CUDA build (--hypre-cache).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CUDA 12.9's nvcc refuses MSVC 19.50 and later, which the windows-latest
runner's Visual Studio 2026 has. build-solver.py now picks the newest
toolset older than 14.50 from any Visual Studio installed for the GPU
build, and falls back to -allow-unsupported-compiler, saying so, when
there is none. The hypre cache key names the toolset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kylebme
kylebme merged commit e542d12 into workbench-ui Oct 10, 2026
5 checks passed
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