Dockerfile.cuda12
1 # CUDA 12.x Development Environment 2 FROM nvidia/cuda:12.2.0-devel-ubuntu22.04 3 4 ENV DEBIAN_FRONTEND=noninteractive 5 ENV CUDA_HOME=/usr/local/cuda 6 ENV PATH=${CUDA_HOME}/bin:${PATH} 7 ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH} 8 9 # Non-root user configuration 10 ARG USERNAME=devuser 11 12 # Install system dependencies 13 RUN apt-get update && apt-get install -y \ 14 build-essential \ 15 cmake \ 16 git \ 17 wget \ 18 curl \ 19 python3 \ 20 python3-pip \ 21 python3-dev \ 22 libopenblas-dev \ 23 libomp-dev \ 24 && rm -rf /var/lib/apt/lists/* 25 26 # Install CUTLASS (cached layer) 27 RUN git clone --depth 1 --branch v3.3.0 https://github.com/NVIDIA/cutlass.git /opt/cutlass 28 ENV CUTLASS_PATH=/opt/cutlass 29 30 # Install Python dependencies first (cached layer) 31 WORKDIR /workspace 32 COPY requirements-dev.txt /workspace/ 33 COPY 01_TVM_End2End_Optimization/requirements.txt /workspace/01_TVM_End2End_Optimization/ 34 COPY 02_ORT_Custom_CUDA_Op/requirements.txt /workspace/02_ORT_Custom_CUDA_Op/ 35 COPY 04_CuTile_NextGen_CUDA/requirements.txt /workspace/04_CuTile_NextGen_CUDA/ 36 37 RUN pip3 install --upgrade pip && \ 38 pip3 install -r requirements-dev.txt && \ 39 pip3 install -r 01_TVM_End2End_Optimization/requirements.txt && \ 40 pip3 install -r 02_ORT_Custom_CUDA_Op/requirements.txt && \ 41 pip3 install -r 04_CuTile_NextGen_CUDA/requirements.txt 42 43 # Copy project source code 44 COPY . /workspace/ 45 46 # Create non-root user for security 47 RUN useradd -m -s /bin/bash ${USERNAME} && \ 48 chown -R ${USERNAME}:${USERNAME} /workspace 49 USER ${USERNAME} 50 51 # Default command 52 CMD ["/bin/bash"]