Fix GPU on RTX 4060 Ti: CUDA 11.8 + CuPy 13.4 with JIT for sm_89

This commit is contained in:
Antoine Jacquin
2026-05-31 18:34:55 +02:00
parent 89f3333b65
commit e9c48f9ff8

View File

@ -1,4 +1,4 @@
FROM nvidia/cuda:12.4.0-devel-ubuntu22.04
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
@ -46,12 +46,14 @@ RUN pip3 install --no-cache-dir \
cmcrameri
# Install CuPy for GPU acceleration (optional - will fallback to numpy if not available)
# CUPY_CUDA_COMPILE_WITH_CACHE=1 enables JIT compilation of kernels for
# GPU architectures not included in the pre-built wheel (e.g. sm_89, sm_120).
# The devel image includes nvcc for JIT compilation. If CuPy still fails
# (CUDA_ERROR_NO_BINARY_FOR_GPU), the pipeline falls back to CPU automatically.
# We use CuPy 13.4 (CUDA 11.x wheel) because CuPy 14.x dropped JIT compilation
# support. With CUPY_CUDA_COMPILE_WITH_CACHE=1, CuPy 13.4 compiles kernels at
# runtime for GPU architectures not in the pre-built wheel (e.g. sm_89 / RTX 4060 Ti).
# The devel image includes nvcc, required for JIT compilation.
# nvcc stays in PATH for the 'lidar' user.
ENV CUPY_CUDA_COMPILE_WITH_CACHE=1
RUN pip3 install --no-cache-dir cupy-cuda12x || echo "CuPy not available - GPU acceleration disabled"
ENV PATH=/usr/local/cuda/bin:${PATH}
RUN pip3 install --no-cache-dir cupy-cuda11x==13.4.0 || echo "CuPy not available - GPU acceleration disabled"
# Copy and install the pipeline package
COPY setup.py .