Skip to content

Fix WSL GPU stalls and show the active rendering device - #4

Merged
fred-huang122 merged 8 commits into
masterfrom
perf/render-device-status
Nov 2, 2026
Merged

fred-huang122 merged 8 commits into
masterfrom
perf/render-device-status

Conversation

@fred-huang122

@fred-huang122 fred-huang122 commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Fix WSL Mesa D3D12 rendering stalls and show the active graphics device in grSim.

  • Emit equivalent triangles for cached fans and convex field spots, preserving coordinates, winding, texture mapping, detail levels and chassis cutouts. Profiling found the D3D12 primitive converter waiting on a fence while mapping cached GPU index data for CPU conversion.
  • Cache renderer/vendor/OpenGL identity from the widget's real context. Show the active renderer, including software/CPU fallback, and Physics: CPU separately, with full tooltips. Describe CPU physics independently of the selected worker count.
  • Keep MainWindow construction hidden and maximize normal startup explicitly. Check that rendering runs on the GUI thread and physics on separate CPU workers. Document selecting/verifying the NVIDIA adapter in WSL.
  • Intercept actual primitive submissions in the Linux rendering regression to reject fan/polygon conversion. Use synchronized window exposure for fallback capture.

This PR remains stacked on #3. Ordinary merges include its corrected robot contacts, faster CPU triangular solves and automatic island-worker policy; those changes remain in the #3 base.

The isolated topology fix previously increased RTX 4060 Laptop rendering from roughly 7 FPS to roughly 50 FPS on stock Ubuntu Mesa 25.2.8. Controlled competing GPU work reduced the fixed build from about 54 to 42 FPS and recovered after it stopped.

The latest paired default-mode comparison keeps the graphics fix and accurate collisions identical, comparing the previous serial default with #3's new CPU math and automatic workers. Three shuffled repetitions per case, 6 v 6 on Division B, normal detail, 956×545 viewport, 3-second warmup and 6-second measurement. A fresh world and atomic placement give both builds matching opposing formations and ball positions; GRSIM_ODE_THREADS is unset for both.

6 v 6 case Previous default FPS New default FPS New simulation/wall speed
Spaced 47.0 50.3 1.000×
Opposing-heading crowd 40.0 47.2 1.002×
Sustained pushing 0 47.3 0.999×

All nine new-default app trials pass their live gate and report three actual helpers. Pushing specifically meets ±2% real-time speed, at least 30 FPS and less than 50 ms final backlog in all three trials: 47.11–47.68 FPS, 0.9975–1.0024×, 6.54–8.71 ms final backlog. The previous default accumulates 1.86–5.52 seconds and suppresses drawing under the existing backlog rule. Forcing serial mode can still lag during cold pushing; automatic workers avoid that default-path failure.

All trials use the real D3D12 NVIDIA GeForce RTX 4060 Laptop GPU context on stock Mesa 25.2.8-0ubuntu0.24.04.2. Background GPU utilization with grSim closed ranges 14–66% (median 34%). Existing workloads remain running; small FPS differences are not universal speedup claims. Crowd ratios above 1 indicate recovery from initial backlog. Renderer and physics probes have different OS thread IDs.

A separate live default-mode collision audit records 47,841 robot contacts at every physics substep, including startup. Peak shell/planar penetration is 0.711 mm, below the existing 2 mm limit, with finite contacts and zero solver warnings/errors; its 15-second measurement maintains 1.0001× and 54.2 FPS. The fixed-step math/trajectory comparisons are documented in #3.

Validation: all 21 local regressions pass. Current CI passes Ubuntu 22.04/24.04, native arm64 macOS 15/26, and downloading/running the exact macOS 15 package on macOS 26. The shipped app reports Apple Software Renderer, status=1 and rendering_on_gui_thread=1 on the hosted Mac, validating packaging/runtime rather than physical Mac GPU throughput.

Profiling datasets, reports, contact probes and prototypes remain outside Git. System graphics drivers and existing user workloads were left unchanged.

Verified Apple Silicon app with graphics fix and updated ODE, macOS 15 or later.

Emit equivalent triangles for cached fans and convex field spots. Mesa D3D12 primitive conversion otherwise maps cached GPU index buffers for CPU conversion and waits on a fence. Add a real rendering-path regression and the verified WSL adapter selection command.
@fred-huang122 fred-huang122 changed the title Show the active graphics device and CPU physics in the status bar Fix WSL GPU stalls and show the active rendering device Nov 1, 2026
@fred-huang122
fred-huang122 changed the base branch from perf/ode-0.16.6-integration to master November 2, 2026 17:20
@fred-huang122
fred-huang122 merged commit 65ecc3c into master Nov 2, 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