Skip to content
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

Build Updates for Ubuntu24.04 #7758

Open
wants to merge 37 commits into
base: mchornyi/24.11/before-code-freeze
Choose a base branch
from

Conversation

nv-anants
Copy link

Thanks for submitting a PR to Triton!
Please go the the Preview tab above this description box and select the appropriate sub-template:

If you already created the PR, please replace this message with one of

and fill it out.

RUN apt update -q=2 \
&& apt install -y gpg wget \
&& wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null \
&& . /etc/os-release \
&& echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
&& apt-get update -q=2 \
&& apt-get install -y --no-install-recommends cmake=3.27.7* cmake-data=3.27.7*
&& apt-get install -y --no-install-recommends cmake=3.28.* cmake-data=3.28.*
Copy link
Contributor

Choose a reason for hiding this comment

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

Version 3.28 has a bug with CUDA Toolkit, it was fixed in latest versions.
https://gitlab.kitware.com/cmake/cmake/-/issues/25484

Copy link
Author

Choose a reason for hiding this comment

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

The version installed is 3.28.3, which includes the bugfix for above issue - Kitware/CMake@f69b9b7

I could pin it further to include patch version, if you think that is better. I don't mind using a recent release as well, just not sure if it will introduce any new issues. What would you recommend?

@@ -96,7 +97,7 @@ RUN apt update -q=2 \
&& . /etc/os-release \
&& echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
&& apt-get update -q=2 \
&& apt-get install -y --no-install-recommends cmake=3.27.7* cmake-data=3.27.7* \
&& apt-get install -y --no-install-recommends cmake=3.28.* cmake-data=3.28.* \
Copy link
Contributor

Choose a reason for hiding this comment

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

Version 3.28 has a bug with CUDA Toolkit, it was fixed in latest versions.
https://gitlab.kitware.com/cmake/cmake/-/issues/25484

@@ -1107,7 +1106,7 @@ def create_dockerfile_buildbase(ddir, dockerfile_name, argmap):
&& . /etc/os-release \\
&& echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null \\
&& apt-get update -q=2 \\
&& apt-get install -y --no-install-recommends cmake=3.27.7* cmake-data=3.27.7*
&& apt-get install -y --no-install-recommends cmake=3.28.* cmake-data=3.28.*
Copy link
Contributor

Choose a reason for hiding this comment

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

Version 3.28 has a bug with CUDA Toolkit, it was fixed in latest versions.
https://gitlab.kitware.com/cmake/cmake/-/issues/25484

@@ -45,7 +45,7 @@ apt update -q=2 \
&& . /etc/os-release \
&& echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
&& apt-get update -q=2 \
&& apt-get install -y --no-install-recommends cmake=3.27.7* cmake-data=3.27.7* \
&& apt-get install -y --no-install-recommends cmake=3.28.* cmake-data=3.28.* \
Copy link
Contributor

Choose a reason for hiding this comment

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

Version 3.28 has a bug with CUDA Toolkit, it was fixed in latest versions.
https://gitlab.kitware.com/cmake/cmake/-/issues/25484

@@ -51,7 +51,7 @@ install_build_deps() {
&& . /etc/os-release \
&& echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
&& apt-get update -q=2 \
&& apt-get install -y --no-install-recommends cmake=3.27.7* cmake-data=3.27.7*
&& apt-get install -y --no-install-recommends cmake=3.28.* cmake-data=3.28.*
Copy link
Contributor

Choose a reason for hiding this comment

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

Version 3.28 has a bug with CUDA Toolkit, it was fixed in latest versions.
https://gitlab.kitware.com/cmake/cmake/-/issues/25484

@@ -48,7 +48,7 @@ apt update -q=2 \
&& . /etc/os-release \
&& echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
&& apt-get update -q=2 \
&& apt-get install -y --no-install-recommends cmake=3.27.7* cmake-data=3.27.7* \
&& apt-get install -y --no-install-recommends cmake=3.28.* cmake-data=3.28.* \
Copy link
Contributor

Choose a reason for hiding this comment

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

Version 3.28 has a bug with CUDA Toolkit, it was fixed in latest versions.
https://gitlab.kitware.com/cmake/cmake/-/issues/25484

@@ -66,7 +66,7 @@ apt update -q=2 \
&& . /etc/os-release \
&& echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
&& apt-get update -q=2 \
&& apt-get install -y --no-install-recommends cmake=3.27.7* cmake-data=3.27.7* rapidjson-dev
&& apt-get install -y --no-install-recommends cmake=3.28.* cmake-data=3.28.* rapidjson-dev
Copy link
Contributor

Choose a reason for hiding this comment

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

Version 3.28 has a bug with CUDA Toolkit, it was fixed in latest versions.
https://gitlab.kitware.com/cmake/cmake/-/issues/25484

@@ -38,7 +38,7 @@ apt update -q=2 \
&& . /etc/os-release \
&& echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
&& apt-get update -q=2 \
&& apt-get install -y --no-install-recommends cmake=3.27.7* cmake-data=3.27.7*
&& apt-get install -y --no-install-recommends cmake=3.28.* cmake-data=3.28.*
Copy link
Contributor

Choose a reason for hiding this comment

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

Version 3.28 has a bug with CUDA Toolkit, it was fixed in latest versions.
https://gitlab.kitware.com/cmake/cmake/-/issues/25484

@@ -221,7 +221,7 @@ ExternalProject_Add(triton-server
-Dre2_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/re2/${LIB_DIR}/cmake/re2
-Dabsl_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/absl/${LIB_DIR}/cmake/absl
-DCURL_DIR:STRING=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/curl/${LIB_DIR}/cmake/CURL
-Dnlohmann_json_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/nlohmann_json/${LIB_DIR}/cmake/nlohmann_json
-Dnlohmann_json_DIR:PATH=${TRITON_THIRD_PARTY_INSTALL_PREFIX}/nlohmann_json/share/cmake/nlohmann_json
Copy link
Contributor

Choose a reason for hiding this comment

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

I this location valid for RHEL as well?

Copy link
Author

Choose a reason for hiding this comment

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

yes, the location was updated in newer version of nlohmann_json so should work for all

@@ -59,20 +59,19 @@ RUN apt-get update && \
libboost-dev \
python3-dev \
python3-pip \
python3-wheel \
python3-setuptools \
Copy link
Contributor

Choose a reason for hiding this comment

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

Wy awe adding setuptools package?

@@ -78,15 +79,15 @@ RUN apt-get update && \
python3 \
python3-pip \
python3-dev \
python3-wheel \
python3-setuptools \
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we are adding setuptools package?

Copy link
Author

Choose a reason for hiding this comment

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

It was removed from the pip install below and added here, cause of the new pip behaviour with system installations. No new install overall

@@ -57,6 +57,7 @@ FROM ${BASE_IMAGE} AS sdk_build

# Ensure apt-get won't prompt for selecting options
ENV DEBIAN_FRONTEND=noninteractive
ENV PIP_BREAK_SYSTEM_PACKAGES=1
Copy link
Contributor

Choose a reason for hiding this comment

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

--break-system-packages
Allow pip to modify an EXTERNALLY-MANAGED Python installation

Could you please clarify which package require it?

Copy link
Author

Choose a reason for hiding this comment

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

All non virtual env installation via pip require this flag now - https://stackoverflow.com/questions/75602063/pip-install-r-requirements-txt-is-failing-this-environment-is-externally-mana

I have added this flag for now to avoid failure down the stack and avoid updating all pip commands. We would need to evaluate switching to python venv's in future for pip install commands

Copy link
Contributor

Choose a reason for hiding this comment

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

I see that link you are referring to is related to https://peps.python.org/pep-0668/ which is outdated.
Could you please elaborate your decision.

Copy link
Author

Choose a reason for hiding this comment

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

Link further points to updated links i think. Anyway, pip has a behaviour change wrt to all system wide installation (non virtual env install). Python base system environment is considered as externally managed and fails to install any packages without this flag. Recommendation from pip side is to either use OS package manager to install such packages on system level, use new pipx tool which behind the scene creates a temporary venv and installs things there (mainly targeted for any CLI python tools) or switch to a virtual env install. You can read the full error message on above stackoverflow link.

This PIP_BREAK_SYSTEM_PACKAGES flag allows us to override this new behavior and continue running pip install commands without any venv activated. However, it still wont allow any upgrades to debian installed packags like python3-pip, wheel, setuptools etc. So i switched whatever packages are available as debian install to install via apt and rest pip install commands will utilize this flag to continue for now with base installation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then logical way here should be usage of virtual environment otherwise we are mixing up system and user space.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, i agree. But right now we are using pip install at a lot of places, so i wasn't sure how to best update/integrate everything with a virtual env

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants