diff --git a/.github/workflows/docker_images.yml b/.github/workflows/docker_images.yml index 2f21b75511..825288a6a7 100644 --- a/.github/workflows/docker_images.yml +++ b/.github/workflows/docker_images.yml @@ -49,6 +49,7 @@ jobs: platform_tag: ${{ steps.info.outputs.platform_tag }} build_docs: ${{ steps.info.outputs.build_docs }} push_to_ngc: ${{ steps.info.outputs.push_to_ngc }} + is_versioned: ${{ steps.info.outputs.is_versioned }} # Needed to define metadata depending on whether an environment secret is defined. environment: @@ -62,10 +63,10 @@ jobs: # multi-platform builds get no platform tag echo "runner=linux-amd64-cpu8" >> $GITHUB_OUTPUT echo "build_docs=${{ inputs.build_docs != 'false' }}" >> $GITHUB_OUTPUT - is_versioned=${{ github.ref_type == 'tag' || github.ref_name == 'main' || startsWith(github.ref_name, 'releases/') }} - is_staging_branch=${{ startsWith(github.ref_name, 'staging/') }} - is_experimental=${{ startsWith(github.ref_name, 'experimental/') }} - push_to_ngc=`${{ inputs.environment && secrets.NGC_CREDENTIALS != '' }} && ($is_versioned || $is_staging_branch || $is_experimental) && echo true || echo` + is_versioned=${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') || startsWith(github.ref_name, 'staging/') }} + has_continuous_deployment=${{ startsWith(github.ref_name, 'experimental/') || github.ref_name == 'main' }} + push_to_ngc=`${{ inputs.environment && secrets.NGC_CREDENTIALS != '' }} && ($is_versioned || $has_continuous_deployment) && echo true || echo` + echo "is_versioned=$is_versioned" >> $GITHUB_OUTPUT echo "push_to_ngc=$push_to_ngc" >> $GITHUB_OUTPUT elif [ -n "$(echo ${{ inputs.platforms }} | grep -i arm)" ]; then platform_tag=`echo ${{ inputs.platforms }} | sed 's/linux\///g' | tr -d ' '` @@ -481,7 +482,7 @@ jobs: image_tag+=pr-${pr_number:-${{ github.event.pull_request.number }}} elif ${{ github.ref_type == 'branch' && github.ref_name == 'main' }}; then image_tag+=latest - elif ${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') }}; then + elif ${{ needs.metadata.outputs.is_versioned == 'true' }}; then image_tag+=`echo ${{ github.ref_name }} | egrep -o "([0-9]{1,}\.)+[0-9]{1,}"` else image_tag+=`echo ${{ github.ref_name }} | tr '/' '-'` diff --git a/.github/workflows/prebuilt_binaries.yml b/.github/workflows/prebuilt_binaries.yml index a69afd7642..0126019ef7 100644 --- a/.github/workflows/prebuilt_binaries.yml +++ b/.github/workflows/prebuilt_binaries.yml @@ -80,7 +80,8 @@ jobs: id: config run: | platform_tag=`echo ${{ inputs.platform }} | sed 's/linux\///g' | tr -d ' '` - if ${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') }}; then + is_versioned=${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') || startsWith(github.ref_name, 'staging/') }} + if ${is_versioned}; then cudaq_version=`echo ${{ github.ref_name }} | egrep -o "([0-9]{1,}\.)+[0-9]{1,}"` else cudaq_version=0.0.0 diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml index 4b73ad1a4d..8ac5e4327b 100644 --- a/.github/workflows/publishing.yml +++ b/.github/workflows/publishing.yml @@ -129,8 +129,9 @@ jobs: fi done - # Version number of the Python wheels - if ${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') }}; then + # CUDA-Q version number + is_versioned=${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') || startsWith(github.ref_name, 'staging/') }} + if ${is_versioned}; then cudaq_version=`echo ${{ github.ref_name }} | egrep -o "([0-9]{1,}\.)+[0-9]{1,}"` else cudaq_version=${release_version:-0.0.0} @@ -737,7 +738,7 @@ jobs: strategy: matrix: - os_image: ['redhat/ubi9:9.2', 'ubuntu:22.04'] + os_image: ['redhat/ubi8:8.0', 'ubuntu:22.04'] cuda_version: ['11.8', '12.0'] fail-fast: false @@ -756,7 +757,7 @@ jobs: - name: Configure validation id: config - run: + run: | cuda_major=`echo ${{ matrix.cuda_version }} | cut -d . -f1` echo "cuda_major=$cuda_major" >> $GITHUB_OUTPUT @@ -780,13 +781,19 @@ jobs: libcublas-$cuda_version_suffix \ cuda-cudart-$cuda_version_suffix \ libcusolver-$cuda_version_suffix + if [ $(echo ${{ matrix.cuda_version }} | cut -d . -f1) -gt 11 ]; then + apt-get install -y --no-install-recommends \ + libnvjitlink-$cuda_version_suffix + fi - name: Runtime dependencies (dnf) if: startsWith(matrix.os_image, 'redhat') run: | dnf install -y --nobest --setopt=install_weak_deps=False \ 'dnf-command(config-manager)' glibc-devel openssh-clients - CUDA_VERSION=${{ matrix.cuda_version }} . scripts/configure_build.sh install-cudart + CUDA_VERSION=${{ matrix.cuda_version }} + DISTRIBUTION=rhel8 + . scripts/configure_build.sh install-cudart # We need to install an MPI implementation, otherwise nothing # will be able to run on the nvidia-mgpu backend. diff --git a/.github/workflows/python_wheels.yml b/.github/workflows/python_wheels.yml index 9d1d3a8206..ce9fa80f57 100644 --- a/.github/workflows/python_wheels.yml +++ b/.github/workflows/python_wheels.yml @@ -103,7 +103,8 @@ jobs: cache_id=`echo ${{ inputs.python_version }}-$devenv_tag | tr . -` mkdir -p "/tmp/wheels" - if ${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') }}; then + is_versioned=${{ github.ref_type == 'tag' || startsWith(github.ref_name, 'releases/') || startsWith(github.ref_name, 'staging/') }} + if ${is_versioned}; then cudaq_version=`echo ${{ github.ref_name }} | egrep -o "([0-9]{1,}\.)+[0-9]{1,}"` else cudaq_version=0.0.0 diff --git a/docker/build/devdeps.ext.Dockerfile b/docker/build/devdeps.ext.Dockerfile index f785391e8c..bc810d710d 100644 --- a/docker/build/devdeps.ext.Dockerfile +++ b/docker/build/devdeps.ext.Dockerfile @@ -17,7 +17,7 @@ # docker build -t ghcr.io/nvidia/cuda-quantum-devdeps:ext -f docker/build/devdeps.ext.Dockerfile . ARG cuda_version=11.8 -ARG base_image=ghcr.io/nvidia/cuda-quantum-devdeps:llvm-main +ARG base_image=ghcr.io/nvidia/cuda-quantum-devdeps:gcc11-main ARG ompidev_image=ghcr.io/nvidia/cuda-quantum-devdeps:cu11-ompi-main FROM $ompidev_image AS ompibuild ARG cuda_version @@ -155,7 +155,7 @@ ENV CUTENSOR_ROOT="$CUTENSOR_INSTALL_PREFIX" ENV LD_LIBRARY_PATH="$CUTENSOR_INSTALL_PREFIX/lib:$LD_LIBRARY_PATH" ENV CPATH="$CUTENSOR_INSTALL_PREFIX/include:$CPATH" -ENV CUTENSOR_VERSION=2.0.1.2 +ENV CUTENSOR_VERSION=2.0.2.5 RUN apt-get update && apt-get install -y --no-install-recommends xz-utils \ && arch_folder=$([ "$(uname -m)" == "aarch64" ] && echo sbsa || echo x86_64) \ && cuda_major=$(echo $CUDA_VERSION | cut -d . -f1) \ diff --git a/docker/release/cudaq.ext.Dockerfile b/docker/release/cudaq.ext.Dockerfile index e4e79b5fbc..aed0c53389 100644 --- a/docker/release/cudaq.ext.Dockerfile +++ b/docker/release/cudaq.ext.Dockerfile @@ -6,7 +6,7 @@ # the terms of the Apache License 2.0 which accompanies this distribution. # # ============================================================================ # -ARG base_image=nvcr.io/nvidia/nightly/cuda-quantum:latest-base +ARG base_image=nvcr.io/nvidia/nightly/cuda-quantum:cu11-latest-base FROM $base_image USER root @@ -29,10 +29,14 @@ RUN if [ -d "$CUDA_QUANTUM_PATH/assets/documentation" ]; then \ && rm -rf "$CUDA_QUANTUM_PATH/assets" "$CUDA_QUANTUM_PATH/bin/migrate_assets.sh" # Install additional runtime dependencies. -RUN apt-get install -y --no-install-recommends \ - libcusolver-11-8 libcublas-11-8 cuda-cudart-11-8 \ - # just here for convenience: - curl jq +RUN cuda_version_suffix=$(echo $CUDA_VERSION | tr . -) && \ + for cudart_dependency in libcusolver libcublas cuda-cudart; do \ + if [ -z "$(apt list --installed | grep -o ${cudart_dependency}-${cuda_version_suffix})" ]; then \ + apt-get install -y --no-install-recommends ${cudart_dependency}-${cuda_version_suffix}; \ + fi \ + done && \ + # just here for convenience: + apt-get install -y --no-install-recommends curl jq RUN if [ -x "$(command -v pip)" ]; then \ apt-get install -y --no-install-recommends gcc libpython3-dev \ && pip install --no-cache-dir jupyterlab; \ diff --git a/docker/release/cudaq.wheel.Dockerfile b/docker/release/cudaq.wheel.Dockerfile index 0823846c50..8c92abc2b2 100644 --- a/docker/release/cudaq.wheel.Dockerfile +++ b/docker/release/cudaq.wheel.Dockerfile @@ -59,6 +59,7 @@ RUN echo "Building wheel for python${python_version}." \ CUDACXX="$CUDA_INSTALL_PREFIX/bin/nvcc" CUDAHOSTCXX=$CXX \ $python -m build --wheel \ && cudaq_major=$(echo ${CUDA_VERSION} | cut -d . -f1) \ + && cudart_libsuffix=$([ "$cuda_major" == "11" ] && echo "11.0" || echo "12") \ && $python -m pip install --no-cache-dir auditwheel \ && LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)/_skbuild/lib" \ $python -m auditwheel -v repair dist/cuda_quantum*linux_*.whl \ @@ -69,7 +70,8 @@ RUN echo "Building wheel for python${python_version}." \ --exclude libcusolver.so.$cudaq_major \ --exclude libcutensor.so.2 \ --exclude libnvToolsExt.so.1 \ - --exclude libcudart.so.$cudaq_major.0 + --exclude libcudart.so.$cudart_libsuffix \ + --exclude libnvidia-ml.so.1 FROM scratch COPY --from=wheelbuild /cuda-quantum/wheelhouse/*manylinux*.whl . diff --git a/docker/test/installer/runtime_dependencies.sh b/docker/test/installer/runtime_dependencies.sh index a8734d95e8..bae4173ef2 100644 --- a/docker/test/installer/runtime_dependencies.sh +++ b/docker/test/installer/runtime_dependencies.sh @@ -32,9 +32,12 @@ case $1 in esac CUDA_DOWNLOAD_URL=https://developer.download.nvidia.com/compute/cuda/repos +CUDA_ARCH_FOLDER=$([ "$(uname -m)" == "aarch64" ] && echo sbsa || echo x86_64) CUDA_VERSION_SUFFIX=$(echo ${CUDART_VERSION:-'11.8'} | tr . -) CUDA_PACKAGES=$(echo "cuda-cudart libcusolver libcublas" | sed "s/[^ ]*/&-${CUDA_VERSION_SUFFIX} /g") -CUDA_ARCH_FOLDER=$([ "$(uname -m)" == "aarch64" ] && echo sbsa || echo x86_64) +if [ $(echo ${CUDART_VERSION} | cut -d . -f1) -gt 11 ]; then + CUDA_PACKAGES+=" libnvjitlink-${CUDA_VERSION_SUFFIX}" +fi if [ "$pkg_manager" == "apt-get" ]; then ## [Prerequisites] diff --git a/scripts/configure_build.sh b/scripts/configure_build.sh index a192834ed0..3d161f930a 100644 --- a/scripts/configure_build.sh +++ b/scripts/configure_build.sh @@ -55,6 +55,10 @@ if [ "$1" == "install-cudart" ]; then cuda-cudart-${version_suffix} \ libcusolver-${version_suffix} \ libcublas-${version_suffix} + if [ $(echo ${CUDA_VERSION} | cut -d . -f1) -gt 11 ]; then + dnf install -y --nobest --setopt=install_weak_deps=False \ + libnvjitlink-${version_suffix} + fi # [