From 460f5c78edec3f523307629cb545ec951df9ce34 Mon Sep 17 00:00:00 2001 From: Kyle McGill Date: Tue, 21 Jan 2025 12:45:45 -0800 Subject: [PATCH 1/4] Downgrade patchelf version from 0.18.0 to 0.17.2 due to patchelf regression Patchelf shipped a regression in 0.18.0 and has since yanked the pypi release pointing to 0.17.2 as the most recent version. However, 0.18.0 is still the version shipped in both the apt and yum repositories, thus we must use pip to install the version we want. See https://github.com/mayeut/patchelf-pypi/issues/87 --- build.py | 18 ++++++++++++------ docs/user_guide/jetson.md | 3 +-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/build.py b/build.py index 91ba43d38d..367fb6edcd 100755 --- a/build.py +++ b/build.py @@ -962,7 +962,6 @@ def create_dockerfile_buildbase_rhel(ddir, dockerfile_name, argmap): libcurl-devel \\ libb64-devel \\ gperftools-devel \\ - patchelf \\ python3-pip \\ python3-setuptools \\ rapidjson-devel \\ @@ -990,7 +989,8 @@ def create_dockerfile_buildbase_rhel(ddir, dockerfile_name, argmap): wheel \\ setuptools \\ docker \\ - virtualenv + virtualenv \\ + patchelf==0.17.2 # Install boost version >= 1.78 for boost::span # Current libboost-dev apt packages are < 1.78, so install from tar.gz @@ -1089,7 +1089,6 @@ def create_dockerfile_buildbase(ddir, dockerfile_name, argmap): libcurl4-openssl-dev \\ libb64-dev \\ libgoogle-perftools-dev \\ - patchelf \\ python3-dev \\ python3-pip \\ python3-wheel \\ @@ -1110,7 +1109,8 @@ def create_dockerfile_buildbase(ddir, dockerfile_name, argmap): RUN pip3 install --upgrade \\ build \\ docker \\ - virtualenv + virtualenv \\ + patchelf==0.17.2 # Install boost version >= 1.78 for boost::span # Current libboost-dev apt packages are < 1.78, so install from tar.gz @@ -1354,11 +1354,14 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu, target_mach libcurl-devel \\ libb64-devel \\ gperftools-devel \\ - patchelf \\ wget \\ python3-pip \\ numactl-devel +RUN pip3 install --upgrade pip \\ + && pip3 install --upgrade \\ + patchelf==0.17.2 + """ else: df += """ @@ -1562,7 +1565,10 @@ def add_cpu_libs_to_linux_dockerfile(backends, target_machine): # patchelf is needed to add deps of libcublasLt.so.12 to libtorch_cuda.so RUN apt-get update \\ - && apt-get install -y --no-install-recommends openmpi-bin patchelf + && apt-get install -y --no-install-recommends openmpi-bin +RUN pip3 install --upgrade pip \\ + && pip3 install --upgrade \\ + patchelf==0.17.2 ENV LD_LIBRARY_PATH /usr/local/cuda/targets/{cuda_arch}-linux/lib:/usr/local/cuda/lib64/stubs:${{LD_LIBRARY_PATH}} """.format( diff --git a/docs/user_guide/jetson.md b/docs/user_guide/jetson.md index e2b2b0ad34..d76d82a78f 100644 --- a/docs/user_guide/jetson.md +++ b/docs/user_guide/jetson.md @@ -82,7 +82,6 @@ apt-get update && \ libtool \ libboost-dev \ rapidjson-dev \ - patchelf \ pkg-config \ libopenblas-dev \ libarchive-dev \ @@ -95,7 +94,7 @@ apt-get update && \ Additional Onnx Runtime dependencies must be installed to build the Onnx Runtime backend: ``` -pip3 install --upgrade flake8 flatbuffers +pip3 install --upgrade flake8 flatbuffers patchelf==0.17.2 ``` Additional PyTorch dependencies must be installed to build (and run) the PyTorch backend: From 1fa090225662c3d2836abb546d3f346508e99c0c Mon Sep 17 00:00:00 2001 From: Kyle McGill <101670481+nv-kmcgill53@users.noreply.github.com> Date: Wed, 22 Jan 2025 09:45:52 -0800 Subject: [PATCH 2/4] Simplify install command Co-authored-by: Ryan McCormick --- build.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.py b/build.py index 367fb6edcd..fa8f7c79d5 100755 --- a/build.py +++ b/build.py @@ -1359,8 +1359,7 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu, target_mach numactl-devel RUN pip3 install --upgrade pip \\ - && pip3 install --upgrade \\ - patchelf==0.17.2 + && pip3 install patchelf==0.17.2 """ else: From 6fa407a5ce27d55ce85034e27567923fc24d9207 Mon Sep 17 00:00:00 2001 From: Kyle McGill Date: Wed, 22 Jan 2025 09:47:50 -0800 Subject: [PATCH 3/4] Simplify installation step --- build.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.py b/build.py index fa8f7c79d5..5335b80bd3 100755 --- a/build.py +++ b/build.py @@ -1566,8 +1566,7 @@ def add_cpu_libs_to_linux_dockerfile(backends, target_machine): RUN apt-get update \\ && apt-get install -y --no-install-recommends openmpi-bin RUN pip3 install --upgrade pip \\ - && pip3 install --upgrade \\ - patchelf==0.17.2 + && pip3 install patchelf==0.17.2 ENV LD_LIBRARY_PATH /usr/local/cuda/targets/{cuda_arch}-linux/lib:/usr/local/cuda/lib64/stubs:${{LD_LIBRARY_PATH}} """.format( From 5099ba430dbe21f0748911ef389e6f6e1669b4e3 Mon Sep 17 00:00:00 2001 From: Kyle McGill Date: Wed, 22 Jan 2025 09:52:53 -0800 Subject: [PATCH 4/4] pre-commit fixes --- build.py | 2 +- docs/user_guide/jetson.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.py b/build.py index 5335b80bd3..76d86e3b52 100755 --- a/build.py +++ b/build.py @@ -1564,7 +1564,7 @@ def add_cpu_libs_to_linux_dockerfile(backends, target_machine): # patchelf is needed to add deps of libcublasLt.so.12 to libtorch_cuda.so RUN apt-get update \\ - && apt-get install -y --no-install-recommends openmpi-bin + && apt-get install -y --no-install-recommends openmpi-bin RUN pip3 install --upgrade pip \\ && pip3 install patchelf==0.17.2 diff --git a/docs/user_guide/jetson.md b/docs/user_guide/jetson.md index d76d82a78f..7ecab6a2b2 100644 --- a/docs/user_guide/jetson.md +++ b/docs/user_guide/jetson.md @@ -1,5 +1,5 @@