Commit 7237bea
committed
fix(build): Handle namespace packages for PyPI CUDA detection
The nvidia package from PyPI (e.g., nvidia-nccl-cu12/cu13) is a
PEP 420 namespace package that doesn't have __file__ attribute.
This caused get_cuda_include_dirs() to fail with TypeError when
building with only NCCL from PyPI.
Use nvidia.__path__[0] which works for both namespace packages
and regular packages.
Fixes: #2331
Signed-off-by: Santosh Bhavani <santosh.bhavani@live.com>1 parent 5f0e3b9 commit 7237bea
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
243 | 249 | | |
244 | 250 | | |
245 | 251 | | |
| |||
0 commit comments