-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding release v0.13.0 of CV-CUDA (#219)
- Loading branch information
1 parent
07d5e44
commit 2a73733
Showing
30 changed files
with
2,350 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Build arguments and version numbers | ||
ARG FROM_IMAGE_NAME=quay.io/pypa/manylinux2014_x86_64 | ||
ARG BUILDER_EXTRA_DEPS=scratch | ||
|
||
# Base image | ||
FROM ${BUILDER_EXTRA_DEPS} AS extra_deps | ||
FROM ${FROM_IMAGE_NAME} | ||
|
||
ARG ARCH=x86_64 | ||
ARG CC=gcc | ||
ARG CXX=g++ | ||
ARG PATCHELF_VERSION=0.17.2 | ||
ARG CMAKE_VERSION=3.20.1 | ||
ARG PYVER=3.8 | ||
ARG PYV=38 | ||
ARG CLANG_VERSION=14.0 | ||
ARG SPHINX_VERSION=4.5.0 | ||
|
||
# Set build arguments as environment variables | ||
ENV ARCH=${ARCH} | ||
ENV CC=${CC} | ||
ENV CXX=${CXX} | ||
ENV PATCHELF_VERSION=${PATCHELF_VERSION} | ||
ENV CMAKE_VERSION=${CMAKE_VERSION} | ||
ENV PYVER=${PYVER} | ||
ENV PYV=${PYV} | ||
ENV CLANG_VERSION=${CLANG_VERSION} | ||
ENV LIBCLANG_VERSION=${CLANG_VERSION} | ||
ENV SPHINX_VERSION=${SPHINX_VERSION} | ||
|
||
# Install additional dependencies | ||
RUN yum install -y ninja-build ccache ShellCheck curl | ||
|
||
# Configure ccache | ||
RUN mkdir -p /cache | ||
COPY ccache.conf /etc/ccache.conf | ||
ENV CCACHE_CONFIGPATH=/etc/ccache.conf | ||
ENV PRE_COMMIT_HOME=/cache/pre-commit | ||
|
||
# Install patchelf (needed to patch rpath of dependencies in bundle-wheel.sh) | ||
RUN wget -q https://github.com/NixOS/patchelf/releases/download/${PATCHELF_VERSION}/patchelf-${PATCHELF_VERSION}-${ARCH}.tar.gz -O /tmp/patchelf.tar.gz && \ | ||
tar -xzf /tmp/patchelf.tar.gz -C /tmp && \ | ||
mv /tmp/bin/patchelf /usr/local/bin/ && \ | ||
rm -rf /tmp/patchelf* | ||
|
||
# Install CMake | ||
RUN cmake --version | ||
RUN wget -q https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${ARCH}.sh -O /tmp/cmake-install.sh && \ | ||
chmod +x /tmp/cmake-install.sh && \ | ||
mkdir /opt/cmake-${CMAKE_VERSION} && \ | ||
/tmp/cmake-install.sh --skip-license --prefix=/opt/cmake-${CMAKE_VERSION} \ | ||
&& rm -f /usr/local/bin/*cmake* \ | ||
&& rm -f /usr/local/bin/cpack \ | ||
&& rm -f /usr/local/bin/ctest && \ | ||
ln -s /opt/cmake-${CMAKE_VERSION}/bin/* /usr/local/bin/ && \ | ||
rm -rf /tmp/cmake-install.sh | ||
|
||
# Set up Python environment variables | ||
ENV PYTHONPATH=/opt/python/v | ||
ENV PYBIN=${PYTHONPATH}/bin | ||
ENV PYLIB=${PYTHONPATH}/lib | ||
|
||
# Create symlink to the desired Python version | ||
RUN ln -s /opt/python/cp${PYV}* ${PYTHONPATH} | ||
|
||
# Update PATH and library paths | ||
ENV PATH=${PYTHONPATH}/bin:/opt/python/*/bin:${PATH} | ||
ENV LD_LIBRARY_PATH=/usr/local/lib:/opt/python/*/lib:${PYLIB}:${LD_LIBRARY_PATH} | ||
ENV LIBRARY_PATH=/usr/local/lib:/opt/python/*/lib:${PYLIB}:${LIBRARY_PATH} | ||
|
||
# Propagate the environment variable to profile.d | ||
RUN echo "export PYTHONPATH=${PYTHONPATH}" >> /etc/profile.d/python.sh && \ | ||
echo "export PYBIN=${PYBIN}" >> /etc/profile.d/python.sh && \ | ||
echo "export PYLIB=${PYLIB}" >> /etc/profile.d/python.sh && \ | ||
echo "export PATH=\${PYTHONPATH}/bin:/opt/python/*/bin:\${PATH}" >> /etc/profile.d/python.sh && \ | ||
echo "export LD_LIBRARY_PATH=/usr/local/lib:/opt/python/*/lib:\${PYLIB}:\${LD_LIBRARY_PATH}" >> /etc/profile.d/python.sh && \ | ||
echo "export LIBRARY_PATH=/usr/local/lib:/opt/python/*/lib:\${PYLIB}:\${LIBRARY_PATH}" >> /etc/profile.d/python.sh && \ | ||
chmod +x /etc/profile.d/python.sh | ||
|
||
# Install Python packages | ||
RUN python3 -m pip install --no-cache-dir \ | ||
breathe \ | ||
cibuildwheel \ | ||
clang==${CLANG_VERSION} \ | ||
exhale \ | ||
flake8 \ | ||
future \ | ||
graphviz \ | ||
numpy \ | ||
pre-commit \ | ||
recommonmark \ | ||
setuptools \ | ||
sphinx_rtd_theme \ | ||
sphinx==${SPHINX_VERSION} \ | ||
twine \ | ||
wheel | ||
|
||
# Update the dynamic linker run-time bindings | ||
RUN ldconfig | ||
|
||
# extra deps | ||
COPY --from=extra_deps / / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
ARG FROM_IMAGE_NAME=quay.io/pypa/manylinux2014_x86_64 | ||
ARG CUDA_IMAGE | ||
ARG BUILDER_CUDA_EXTRA_DEPS=scratch | ||
|
||
FROM ${BUILDER_CUDA_EXTRA_DEPS} AS cuda_extra_deps | ||
FROM ${CUDA_IMAGE} AS cuda | ||
|
||
# Find and copy libcuda.so* to /cuda_libs | ||
RUN mkdir /cuda_libs && \ | ||
find /usr -name 'libcuda.so*' -exec cp {} /cuda_libs/ \; | ||
|
||
FROM ${FROM_IMAGE_NAME} | ||
|
||
ENV PATH=/usr/local/cuda/bin:${PATH} | ||
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:${LD_LIBRARY_PATH} | ||
|
||
ENV NVIDIA_DRIVER_CAPABILITIES=video,compute,utility,compat32 | ||
|
||
# Propagating the environment variable to profile.d | ||
RUN echo "export NVIDIA_DRIVER_CAPABILITIES=video,compute,utility,compat32" >> /etc/profile.d/nvidia.sh && \ | ||
echo "export PATH=/usr/local/cuda/bin:\${PATH}" >> /etc/profile.d/nvidia.sh && \ | ||
echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:\${LD_LIBRARY_PATH}" >> /etc/profile.d/nvidia.sh && \ | ||
chmod +x /etc/profile.d/nvidia.sh | ||
|
||
# CUDA | ||
COPY --from=cuda /usr/local/cuda /usr/local/cuda | ||
|
||
# Copy libcuda.so* files | ||
COPY --from=cuda /cuda_libs/* /usr/lib64/ | ||
|
||
# Test CUDA compiler | ||
RUN nvcc --version | ||
|
||
# Ensure tmp is writable by all users recursively | ||
RUN chmod -R a+rw /tmp | ||
|
||
RUN git clone https://github.com/google/googletest.git -b release-1.10.0 && \ | ||
pushd googletest && \ | ||
mkdir build && \ | ||
pushd build && \ | ||
cmake .. && \ | ||
make -j$(nproc) && make install && \ | ||
popd && popd && rm -rf googletest | ||
|
||
# Extra deps | ||
COPY --from=cuda_extra_deps / / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
ARG FROM_IMAGE_NAME=nvidia/cuda:11.4.3-devel-centos7 | ||
FROM ${FROM_IMAGE_NAME} AS cuda | ||
|
||
RUN ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime |
Oops, something went wrong.