Commit 1c8da17
authored
Fix numba-cuda CPU import crash after base image upgrade (#1548)
## Problem
After merging #1547 (Colab base image upgrade), the main branch CI is
failing on the **Test CPU Image** stage (build #1924). The upgraded
`numba-cuda` v0.30.0 now depends on `cuda-bindings` which requires
`libcudart.so` at import time — this crashes on the CPU image where no
CUDA runtime is installed.
Two tests fail:
- `test_numba` — `from numba import cuda` at module level triggers the
crash
- `test_tsfresh` — `tsfresh` → `stumpy` → `from numba import cuda` →
same crash
```
cuda.pathfinder._dynamic_libs.load_dl_common.DynamicLibNotFoundError:
Failure finding "libcudart.so": No such file: libcudart.so*
```
## Fix
### Dockerfile.tmpl
- Keep `numba` upgrade for both CPU and GPU images (needed for NumPy
2.4)
- Move `numba-cuda` install into the GPU-only section (`{{ if eq
.Accelerator "gpu" }}`)
### test_numba.py
- Move `from numba import cuda` from module-level into the `@gpu_test`
method (lazy import)
### test_tsfresh.py
- Guard the `tsfresh` import with try/except and skip the test if it
fails on CPU
b/4852755591 parent d6a167a commit 1c8da17
3 files changed
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
0 commit comments