Skip to content

Conversation

@tianleiwu
Copy link
Contributor

@tianleiwu tianleiwu commented Nov 4, 2025

(1) Not install cudnn9-cuda-12 since the base image has cudnn so no need to install again.
(2) Upgrade ubuntu to 24.04

This fixes the following error:

#11 315.1  cudnn9-cuda-12 : Depends: cudnn9-cuda-12-9 (>= 9.10.2.21) but it is not going to be installed
#11 315.1 E: Unable to correct problems, you have held broken packages.

@tianleiwu tianleiwu requested a review from Copilot November 4, 2025 19:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the Docker base image from Ubuntu 20.04 to Ubuntu 24.04 for GPU package building and testing, ensuring compatibility with modern tooling and dependencies.

Key changes:

  • Updated base image from nvidia/cuda:12.8.1-cudnn-devel-ubuntu20.04 to nvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04
  • Improved Dockerfile best practices (cleanup, layer optimization, PEP 668 compliance)
  • Updated Azure pipeline references to use the new Ubuntu 24.04 Dockerfile

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2404_gpu Migrated from Ubuntu 20.04 to 24.04, consolidated package installation, added PEP 668 workaround, improved Docker layer cleanup
tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml Updated references from Ubuntu 20.04 to 24.04 Dockerfile and base image
Comments suppressed due to low confidence (2)

tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2404_gpu:32

  • Removing the EXTERNALLY-MANAGED file bypasses PEP 668 protections designed to prevent conflicts between system packages and pip-installed packages. Consider using a Python virtual environment or installing packages with 'pip install --user' instead to avoid potential system instability.
    tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2404_gpu:63
  • The 'chown' operation on line 63 is redundant. The 'adduser' command on line 62 automatically creates the home directory with correct ownership for the new user.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tianleiwu tianleiwu marked this pull request as draft November 4, 2025 20:02
snnn
snnn previously approved these changes Nov 4, 2025
Copy link
Contributor

@snnn snnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going forward we should consider using uv and uv's venv to manage dependencies, then we won't have this global pip installation problem.

@snnn
Copy link
Contributor

snnn commented Nov 4, 2025

Example docker:

FROM nvidia/cuda:12.9.1-cudnn-devel-ubuntu24.04

RUN apt-get update && apt-get install -y git curl libc6-dev git unzip zip python3-dev gdb gcc g++ gh pkg-config libssl-dev libstdc++6-13-dbg python3-pip python3-pkg-resources python3-setuptools python3-wheel valgrind wget patch patchutils binutils-dev
RUN cd /tmp && curl -o cmake.tar.gz -sSL https://github.com/Kitware/CMake/releases/download/v4.1.2/cmake-4.1.2-linux-x86_64.tar.gz && tar -zxf cmake.tar.gz -C /usr --strip=1

USER ubuntu

RUN cd /tmp && curl -o /tmp/1.sh  --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs && bash 1.sh -y

ENV PATH=/home/ubuntu/.cargo/bin:/home/ubuntu/.local/bin:$PATH

RUN cd /tmp && git clone https://github.com/astral-sh/uv.git  && cd uv/crates/uv && cargo install --path .  && \
      cd $HOME && uv venv --python 3.13 --seed && . .venv/bin/activate && uv pip install onnx-ir onnx vllm --torch-backend=auto && uv tool install "huggingface_hub" 

@tianleiwu tianleiwu requested a review from snnn November 4, 2025 23:55
@tianleiwu tianleiwu marked this pull request as ready for review November 4, 2025 23:56
@tianleiwu tianleiwu enabled auto-merge (squash) November 5, 2025 07:20
@tianleiwu tianleiwu merged commit c221fd9 into main Nov 5, 2025
106 of 109 checks passed
@tianleiwu tianleiwu deleted the tlwu/fix_2004_docker_file branch November 5, 2025 18:27
Rohanjames1997 pushed a commit to Rohanjames1997/onnxruntime that referenced this pull request Dec 4, 2025
(1) Not install cudnn9-cuda-12 since the base image has cudnn so no need
to install again.
(2) Upgrade ubuntu to 24.04

This fixes the following error:
```
microsoft#11 315.1  cudnn9-cuda-12 : Depends: cudnn9-cuda-12-9 (>= 9.10.2.21) but it is not going to be installed
microsoft#11 315.1 E: Unable to correct problems, you have held broken packages.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants