Skip to content

Commit

Permalink
CONSOLIDATED COMMITS: Updates to build on Jammy (UB22.04), Noble (UB2…
Browse files Browse the repository at this point in the history
…4.04) and CentOS

=====================================================================================

Updates to build on Jammy

- Fortran package installation moved after gcc
- Update libtinfo search code in cmake1
- Install libstdc++.so

(cherry picked from commit 6e39ade)
(cherry picked from commit f6ad627)

Updated condition for libstc++ for Jammy

(cherry picked from commit f32cab4)
(cherry picked from commit bb7fd30)

Set ROCM_PATH ENV in Centos docker container

(cherry picked from commit b774eaa)
(cherry picked from commit da86387)

[release/2.5] Changes to support UB 24.04 build (#1816)

Fixes SWDEV-505665

Changes applied from #1816

Successful PyTorch build:
http://rocm-ci.amd.com/job/mainline-framework-pytorch-2.5-ub24-py3.12-ci/17/

---------

Co-authored-by: pramenku <[email protected]>
Co-authored-by: Nichols A. Romero <[email protected]>
(cherry picked from commit f638998)
  • Loading branch information
pruthvistony authored and jithunnair-amd committed Feb 20, 2025
1 parent ba1ba26 commit 70f3007
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 32 deletions.
2 changes: 2 additions & 0 deletions .ci/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ if [[ "$image" == *-focal* ]]; then
UBUNTU_VERSION=20.04
elif [[ "$image" == *-jammy* ]]; then
UBUNTU_VERSION=22.04
elif [[ "$image" == *-noble* ]]; then
UBUNTU_VERSION=24.04
elif [[ "$image" == *ubuntu* ]]; then
extract_version_from_image_name ubuntu UBUNTU_VERSION
elif [[ "$image" == *centos* ]]; then
Expand Down
1 change: 1 addition & 0 deletions .ci/docker/centos-rocm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ RUN rm install_rocm_magma.sh
COPY ./common/install_amdsmi.sh install_amdsmi.sh
RUN bash ./install_amdsmi.sh
RUN rm install_amdsmi.sh
ENV ROCM_PATH /opt/rocm
ENV PATH /opt/rocm/bin:$PATH
ENV PATH /opt/rocm/hcc/bin:$PATH
ENV PATH /opt/rocm/hip/bin:$PATH
Expand Down
4 changes: 4 additions & 0 deletions .ci/docker/common/common_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ conda_install() {
as_jenkins conda install -q -n py_$ANACONDA_PYTHON_VERSION -y python="$ANACONDA_PYTHON_VERSION" $*
}

conda_install_through_forge() {
as_jenkins conda install -c conda-forge -q -n py_$ANACONDA_PYTHON_VERSION -y python="$ANACONDA_PYTHON_VERSION" $*
}

conda_run() {
as_jenkins conda run -n py_$ANACONDA_PYTHON_VERSION --no-capture-output $*
}
Expand Down
9 changes: 9 additions & 0 deletions .ci/docker/common/install_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ install_ubuntu() {
elif [[ "$UBUNTU_VERSION" == "22.04"* ]]; then
cmake3="cmake=3.22*"
maybe_libiomp_dev=""
elif [[ "$UBUNTU_VERSION" == "24.04"* ]]; then
cmake3="cmake=3.28*"
maybe_libiomp_dev=""
else
cmake3="cmake=3.5*"
maybe_libiomp_dev="libiomp-dev"
Expand Down Expand Up @@ -83,6 +86,12 @@ install_ubuntu() {
# see: https://github.com/pytorch/pytorch/issues/65931
apt-get install -y libgnutls30

# Required to install the fortran after gcc update
if [[ "$UBUNTU_VERSION" == "22.04"* ]]; then
apt autoremove -y gfortran
apt-get update -y
apt-get install -y gfortran
fi
# Cleanup package manager
apt-get autoclean && apt-get clean
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down
4 changes: 4 additions & 0 deletions .ci/docker/common/install_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
${SCRIPT_FOLDER}/install_magma_conda.sh $(cut -f1-2 -d'.' <<< ${CUDA_VERSION}) ${ANACONDA_PYTHON_VERSION}
fi

if [[ "$UBUNTU_VERSION" == "24.04"* ]] ; then
conda_install_through_forge libstdcxx-ng=14
fi

# Install some other packages, including those needed for Python test reporting
pip_install -r /opt/conda/requirements-ci.txt

Expand Down
12 changes: 5 additions & 7 deletions .ci/docker/common/install_rocm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ ver() {

install_ubuntu() {
apt-get update
if [[ $UBUNTU_VERSION == 18.04 ]]; then
# gpg-agent is not available by default on 18.04
apt-get install -y --no-install-recommends gpg-agent
fi
if [[ $UBUNTU_VERSION == 20.04 ]]; then
# gpg-agent is not available by default on 20.04
apt-get install -y --no-install-recommends gpg-agent
# gpg-agent is not available by default
apt-get install -y --no-install-recommends gpg-agent
if [[ $(ver $UBUNTU_VERSION) -ge $(ver 22.04) ]]; then
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \
| sudo tee /etc/apt/preferences.d/rocm-pin-600
fi
apt-get install -y kmod
apt-get install -y wget
Expand Down
3 changes: 3 additions & 0 deletions .ci/docker/requirements-ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ click
#test that import:

coremltools==5.0b5 ; python_version < "3.12"
coremltools==7.2 ; python_version == "3.12"
#Description: Apple framework for ML integration
#Pinned versions: 5.0b5
#test that import:
Expand Down Expand Up @@ -63,6 +64,7 @@ lark==0.12.0
#test that import:

librosa>=0.6.2 ; python_version < "3.11"
librosa==0.10.2 ; python_version == "3.12"
#Description: A python package for music and audio analysis
#Pinned versions: >=0.6.2
#test that import: test_spectral_ops.py
Expand Down Expand Up @@ -111,6 +113,7 @@ networkx==2.8.8
numba==0.49.0 ; python_version < "3.9"
numba==0.55.2 ; python_version == "3.9"
numba==0.55.2 ; python_version == "3.10"
numba==0.60.0 ; python_version == "3.12"
#Description: Just-In-Time Compiler for Numerical Functions
#Pinned versions: 0.54.1, 0.49.0, <=0.49.1
#test that import: test_numba_integration.py
Expand Down
25 changes: 0 additions & 25 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -996,31 +996,6 @@ endif()

# ---[ HIP
if(USE_ROCM)
# This prevents linking in the libtinfo from /opt/conda/lib which conflicts with ROCm libtinfo.
# Currently only active for Ubuntu 20.04 and greater versions.
if(UNIX AND EXISTS "/etc/os-release")
file(STRINGS /etc/os-release OS_RELEASE)
set(DISTRO_NAME "")
set(DISTRO_VERSION "")
foreach(line ${OS_RELEASE})
string(REGEX MATCH "^NAME=" DISTRO_NAME_MATCH ${line})
if(NOT DISTRO_NAME_MATCH STREQUAL "")
string(REGEX REPLACE "^NAME=\"(.*)\"" "\\1" DISTRO_NAME ${line})
endif()
string(REGEX MATCH "^VERSION_ID=" DISTRO_VERSION_MATCH ${line})
if(NOT DISTRO_VERSION_MATCH STREQUAL "")
string(REGEX REPLACE "^VERSION_ID=\"(.*)\"" "\\1" DISTRO_VERSION ${line})
endif()
endforeach()
if(DISTRO_NAME STREQUAL "Ubuntu" AND DISTRO_VERSION VERSION_GREATER_EQUAL "20.04")
find_library(LIBTINFO_LOC tinfo NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH)
if(LIBTINFO_LOC)
get_filename_component(LIBTINFO_LOC_PARENT ${LIBTINFO_LOC} DIRECTORY)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath-link,${LIBTINFO_LOC_PARENT}")
endif()
endif()
endif()

include(${CMAKE_CURRENT_LIST_DIR}/public/LoadHIP.cmake)
if(PYTORCH_FOUND_HIP)
message(INFO "Compiling with HIP for AMD.")
Expand Down

0 comments on commit 70f3007

Please sign in to comment.