runner: detect GPUs on Windows via Win32_VideoController (#39) #40
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
blocked
draft
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
s1d3sw1ped/jiggablend!40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ash/windows-gpu-detect-39"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #39
Why
On Windows the runner had no host GPU probe (only
/sys/class/drmandlspci), soDetectGPUBackends()returned ok=false and every job was forced to CPU. That blocks the ai1 Windows 520-560 render test.What changed
internal/runner/blender/detect.go: probes are now an ordered list (runGPUProbes). NewDetectGPUs()returns vendors plus probe source and device names;DetectGPUBackends()keeps its signature and wraps it.detect_probes_other.go(!windows) = DRM then lspci, same order and same functions as before.detect_probes_windows.go=Get-CimInstance Win32_VideoControllervia PowerShell, parsed byparseWin32VideoControllers(AdapterCompatibility|Name; maps AMD/ATI/Radeon, NVIDIA, Intel; ignores Microsoft Basic/Remote Display adapters).runner.go: logsGPU devices detected via <source>: <devices>at startup, before the existingGPU backend detection: AMD=...line.--sandbox none, GPU detection log).drmClassDir, default/sys/class/drm) and lspci parsing moved intoparseLSPCI(same body).Acceptance criteria (Mira)
gpuDetectionFailedstays false. Unit tested; real-host proof pending (see Gap).detect_windows_test.go(Radeon 8060S + Basic Display adapter, NVIDIA + Intel, no-GPU inputs incl. CRLF/empty, vendor-only name). Platform-neutral, so they run in Linux CI.GPU devices detected via win32_videocontroller: AMD Radeon(TM) 8060S Graphics(Linux:via drm: AMDetc.).Testing
go test -race -count=3 -shuffle=on ./internal/runner/... ./internal/manager/...on the jumpbox: all pass exceptinternal/runner/encodingTestIntegration_Encode_EXR_H264, which needs ffmpeg (not installed on the jumpbox; CI installs it).internal/runner/blender: 24 tests pass.677d240(after review 1087 renameddetect_windows_test.gotodetect_win32_parse_test.go). Jumpboxgo test -v -run Win32 ./internal/runner/blender/:CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build ./cmd/jiggablendandGOOS=windows go vet ./internal/runner/...clean.windowsbuild-tag file is compiled-checked locally, not run in CI.Gap
Not run on real Windows hardware. The PowerShell call and Jerry's issue acceptance (render log "Render devices (GPU only, 1 enabled) ... [HIP]" / "Final Cycles device: GPU") are proven only by Jerry's post-merge ai1 Windows 520-560 test.
Risk / rollback
Windows-only behavior change (build tag). Linux path is the same functions in the same order plus one extra log line. Rollback: revert this PR.
Close, but one thing needs fixing before this can go.
internal/runner/blender/detect_windows_test.gowon't run in Linux CI. Go treats a_windows_test.gofile name as a build constraint, so that file only compiles when GOOS=windows. The PR body says those parser tests are platform-neutral and run in CI, but on ubuntu-latest (and in your jumpbox run) they're silently skipped, so acceptance criterion 3 isn't actually covered yet.Fix on this same branch: rename it to something without a GOOS suffix, for example
detect_win32_parse_test.go.parseWin32VideoControllerslives indetect.gowith no build tag, so the tests will compile and run on Linux as-is. Then confirm withgo test -v -run Win32 ./internal/runner/blender/that all four show up as PASS, and push.detect_linux_test.gois fine to keep (Linux-only is what it tests), just know it's also suffix-gated.Everything else looks good: base is current develop (
77a22e2), CI is green, the Linux path keeps the same probes in the same order with tests pinning it, the Windows probe is behind a build tag, and the startup log line matches what Jerry needs. Not security-sensitive, so no Blake review needed. I'll re-review on the next push.GO. The rename fixed it:
detect_win32_parse_test.gohas no GOOS suffix now, so the four Win32 parser tests compile and run in Linux CI, which covers acceptance criterion 3.Re-checked on
677d240: base is still current develop (77a22e2), CI is green, the Linux path keeps DRM then lspci with the same matching and tests pinning it, the PowerShell probe sits behind thewindowsbuild tag, and the startup log line is what Jerry needs. The remaining gap is the one you already called out: no run on real Windows hardware yet, which is Jerry's ai1 test after merge.Not security-sensitive, so no Blake review needed. Linus can merge, and on merge the PR and merge commit go on #39 for Jerry.