-
Notifications
You must be signed in to change notification settings - Fork 900
docker: Add CUDA 13.2 Docker containers #2843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| FROM nvidia/cuda:13.2.0-devel-ubuntu24.04 | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # Update package lists and install system dependencies | ||
| RUN apt-get update && apt-get install -y \ | ||
| curl \ | ||
| git \ | ||
| wget | ||
|
|
||
| # Install python | ||
| COPY docker/install/install_python.sh /install/install_python.sh | ||
| RUN bash /install/install_python.sh /opt/conda py312 | ||
|
|
||
| # Set home directory | ||
| WORKDIR /workspace | ||
|
|
||
| RUN echo "source activate py312" >> ~/.bashrc | ||
| ENV PATH="/opt/conda/bin:$PATH" | ||
| ENV PATH="/opt/conda/envs/py312/bin:$PATH" | ||
|
|
||
| # Set LD_LIBRARY_PATH to ensure pip-installed nvidia-cublas takes precedence over system libraries | ||
| ENV LD_LIBRARY_PATH="/opt/conda/envs/py312/lib/python3.12/site-packages/nvidia/cu13/lib/:$LD_LIBRARY_PATH" | ||
|
|
||
| # Triton | ||
| ENV TRITON_PTXAS_PATH="/usr/local/cuda/bin/ptxas" | ||
|
|
||
| # Install torch and other python packages | ||
| # use nightly/cu132 temporarily and change to cu132 when torch releases stable version | ||
| COPY requirements.txt /install/requirements.txt | ||
| COPY docker/install/install_python_packages.sh /install/install_python_packages.sh | ||
| RUN bash /install/install_python_packages.sh nightly/cu132 | ||
|
|
||
| # Install tilelang and cuda-tile | ||
| RUN pip install tilelang cuda-tile | ||
|
|
||
| # Install mpi4py in the conda environment | ||
| RUN conda install -n py312 -y mpi4py mpich | ||
|
|
||
| # Configure pip for user-site installations (allows arbitrary users to install packages) | ||
| # This enables 'pip install --user' and 'pip install -e .' to work for any user | ||
| RUN mkdir -p /opt/pip-user && chmod 1777 /opt/pip-user | ||
| ENV PYTHONUSERBASE=/opt/pip-user | ||
| ENV PATH="/opt/pip-user/bin:$PATH" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| FROM nvidia/cuda:13.2.0-devel-ubuntu24.04 | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # Update package lists and install system dependencies | ||
| RUN apt-get update && apt-get install -y \ | ||
| curl \ | ||
| git \ | ||
| wget \ | ||
| clang-format \ | ||
| clangd-19 \ | ||
| vim \ | ||
| zsh \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
Comment on lines
+6
to
+14
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To optimize Docker layers and reduce build time, it's best to install all |
||
|
|
||
| # Create a non-root user | ||
| ARG USERNAME=devuser | ||
| ARG USER_UID=1003 | ||
| ARG USER_GID=$USER_UID | ||
|
|
||
| # Create the user | ||
| RUN groupadd --gid $USER_GID $USERNAME \ | ||
| && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
| # [Optional] Add sudo support | ||
| && apt-get update \ | ||
| && apt-get install -y sudo \ | ||
| && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
| && chmod 0440 /etc/sudoers.d/$USERNAME \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
Comment on lines
+22
to
+29
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following the previous suggestion to install |
||
|
|
||
| # Remove default 'ubuntu' user (UID 1000) to prevent devcontainer permission conflicts | ||
| # Ref: https://github.com/rapidsai/devcontainers/pull/373 | ||
| RUN if grep ubuntu:x:1000:1000 /etc/passwd >/dev/null; then userdel -f -r ubuntu; fi | ||
|
|
||
| # Switch to non-root user | ||
| USER $USERNAME | ||
| WORKDIR /home/$USERNAME | ||
|
|
||
| # Install python | ||
| COPY docker/install/install_python.sh /install/install_python.sh | ||
| RUN bash /install/install_python.sh /home/$USERNAME/conda py312 | ||
|
|
||
| RUN echo "source activate py312" >> ~/.bashrc | ||
| ENV PATH="/home/$USERNAME/conda/bin:$PATH" | ||
| ENV PATH="/home/$USERNAME/conda/envs/py312/bin:$PATH" | ||
|
|
||
| # Install torch and other python packages | ||
| # use nightly/cu132 temporarily and change to cu132 when torch releases stable version | ||
| COPY requirements.txt /install/requirements.txt | ||
| COPY docker/install/install_python_packages.sh /install/install_python_packages.sh | ||
| RUN bash /install/install_python_packages.sh nightly/cu132 && pip3 install pre-commit | ||
|
Comment on lines
+43
to
+51
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the dev image on the same CUDA library search order as the CI image.
Suggested diff RUN echo "source activate py312" >> ~/.bashrc
ENV PATH="/home/$USERNAME/conda/bin:$PATH"
ENV PATH="/home/$USERNAME/conda/envs/py312/bin:$PATH"
+ENV LD_LIBRARY_PATH="/home/$USERNAME/conda/envs/py312/lib/python3.12/site-packages/nvidia/cu13/lib/:$LD_LIBRARY_PATH"π€ Prompt for AI Agents |
||
|
|
||
| # Install tilelang and cuda-tile | ||
| RUN pip install tilelang cuda-tile | ||
|
|
||
| # Install mpi4py in the conda environment | ||
| RUN conda install -n py312 -y mpi4py mpich | ||
|
|
||
| # Install oh-my-zsh | ||
| RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended | ||
|
|
||
| # Install zsh-autosuggestions | ||
| RUN git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | ||
|
|
||
| # Configure zsh | ||
| RUN sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="fino-time"/' ~/.zshrc && \ | ||
| sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions)/' ~/.zshrc | ||
|
|
||
| # clangd | ||
| ENV PATH="/usr/lib/llvm-19/bin:$PATH" | ||
|
|
||
| # Triton | ||
| ENV TRITON_PTXAS_PATH="/usr/local/cuda/bin/ptxas" | ||
|
|
||
| # Set zsh as default shell | ||
| ENV SHELL=/bin/zsh | ||
| CMD [ "zsh" ] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a Docker best practice to clean up the
aptcache within the sameRUNlayer thatapt-get updateis called. This reduces the final image size. Please add&& rm -rf /var/lib/apt/lists/*to this command.