Repository navigation
fix(runtime): report CUDA probe stage and Driver API error - #1341
Conversation
|
Joint local verification of #1337–#1341 against main 565d7fd, including the constructor-model correction in #1338:
No physical GPU, macOS/Metal runtime, or mini-cluster gate was exercised. Separate PR source branches remain independent; the integration branch is local verification only. |
Lorenzobattistela
left a comment
There was a problem hiding this comment.
Thanks — the probe refactor looks correct. I fault-injected each Driver API stage against stubs: the messages are right, and the context is released when cuCtxSetCurrent fails. Merged onto main bf96827, all gates pass on the cluster (repo 50/50, test 1551/1551, perf 121–123/124 against 123/124 on main, ping 47/47).
- After #1281, comp.ts is at 62984 on main and 63020 with this PR, so the Dialect/Gpu/Cube comment compression isn't needed anymore. Please restore those comments. The Cube one lost the reason the column grows "no more" than a LINE per thread (the tree-matmul 15 MB -> 68 MB case), and the Dialect one lost "a segment is a case of the device's switch".
Also, in general, do not just trim comments unrelated to your PR to make it fit the cap.
-
Could the managed-access message keep the WSL2 hint, e.g. "CUDA device lacks concurrent managed access (WSL2 lacks it)"? That's still the common cause of that particular failure.
-
Nit: GPU_CHECK stringifies the whole call (cuDeviceGetAttribute(&managed, CU_DEVICE_ATTRIBUTE_..., gpu_dev) failed), but the context-set case prints only the function name. Consider printing just the function name everywhere.
-
Please drop the CHANGELOG entry, they're never added on PRs, just on releases.
The CPU-only gpu_probe() is a string literal. Writing the probe result as `active ? gpu_probe() : NULL` kept clang from folding dev to false, so corpus_setup kept its GPU branches, cube_run and corpus_lay were no longer inlined into main, and editdist SEQ-CPU took 2.39 s instead of 1.92 s (1.24x). With "" as the inactive value, dev folds again. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Confirmed the merged probe reports only the Driver API function name, retains the WSL2 hint specifically for missing concurrent managed access, and releases the primary context after a context-set failure. Thanks for restoring the unrelated runtime comments and checking this on the cluster. I will not trim unrelated comments to meet a cap in future PRs, and will leave release notes to releases. No physical CUDA/Metal claim from this Linux host. |
Fixes #1145.
gpu_probereturnsNULLon success or the reason it failed, instead of one bool, so--gpu onno longer blames WSL2 for every failure.cuInit,cuDeviceGet, the concurrent-managed-access query andcuDevicePrimaryCtxRetaingo throughGPU_CHECK, which reports<function> failed: <cuGetErrorName>, e.g.cuInit failed: CUDA_ERROR_UNKNOWN. A failedcuCtxSetCurrentreleases the retained primary context and reports the same way. A device without concurrent managed access getsCUDA device lacks concurrent managed access (WSL2 lacks it). The L2 size query stays best-effort.this binary found no usable Metal GPU.this binary has no CUDA or Metal GPU support.--gpu onprints the reason and exits 1. Automatic mode still falls back to the CPU silently.--gpu-builduses the new return.main()keepsdeva compile-timefalsein GPU-less builds (whyis""when the GPU is not requested). The first form,active ? gpu_probe() : NULL, kept clang from folding it, socube_runandcorpus_laystopped inlining intomainand editdist SEQ-CPU went from 1.92 s to 2.39 s (1.24x).Verification, merged onto main 5169abf:
cuCtxSetCurrentreleases the context.--gpu onand--gpu off; a CPU-only build exits 1 with the no-support message under--gpu onand runs normally without it.Not tested on a CUDA GPU.
🤖 Generated with Claude Code