Commit feca367
Abraham Sewill
build.rs: gate NVIDIA auto-detect on sm_61 minimum (our README floor)
Dual-vendor host hit: AMD W5700 + ancient secondary NVIDIA (sm_52,
Maxwell 1). nvidia-smi reports the NVIDIA, so build.rs routed onto
the CUB/BUILD_CUDA=ON + ACPP_TARGETS=generic (SSCP) path — ignoring
the actually-useful AMD card. Compile then failed inside
AdaptiveCpp's half.hpp: it references __hadd/__hsub/__hmul/__hdiv/
__hlt/__hle/__hgt/__hge unconditionally in any nvcc device pass,
but cuda_fp16.h guards those behind __CUDA_ARCH__ >= 530. So the
existing `-include=cuda_fp16.h` workaround can't save a sm_52 user:
the symbols literally aren't in the header at that arch.
Our own README minimum is sm_61 (Pascal / GTX 10-series). Anything
below that is unsupported by design and shouldn't be steering
vendor-precedence. Add `usable_nvidia_arch()` that returns Some
only when `detect_cuda_arch` reports ≥ 61; emit a cargo:warning
and return None otherwise. Route both the ACPP_TARGETS and
XCHPLOT2_BUILD_CUDA defaults through it so the W5700 user's build
correctly falls through to AMD detection → BUILD_CUDA=OFF +
ACPP_TARGETS=hip:gfx1013 automatically.
Explicit CUDA_ARCHITECTURES / XCHPLOT2_BUILD_CUDA / ACPP_TARGETS env
overrides still win.1 parent 114f17b commit feca367
1 file changed
Lines changed: 42 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
39 | 70 | | |
40 | 71 | | |
41 | 72 | | |
| |||
146 | 177 | | |
147 | 178 | | |
148 | 179 | | |
149 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
150 | 185 | | |
151 | 186 | | |
152 | 187 | | |
| |||
172 | 207 | | |
173 | 208 | | |
174 | 209 | | |
175 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
176 | 216 | | |
177 | 217 | | |
178 | 218 | | |
| |||
0 commit comments