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

Packaging fixes #2355

Merged
merged 10 commits into from
Nov 6, 2024
6 changes: 4 additions & 2 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,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

Expand Down Expand Up @@ -786,7 +786,8 @@ jobs:
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=rhel9 \
. 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.
Expand All @@ -797,6 +798,7 @@ jobs:
bash ~/.miniconda3/miniconda.sh -b -u -p ~/.miniconda3
rm -rf ~/.miniconda3/miniconda.sh
eval "$(~/.miniconda3/bin/conda shell.bash hook)"
conda config --set solver classic
conda install -y -c conda-forge openmpi

echo 'eval "$(~/.miniconda3/bin/conda shell.bash hook)"' >> ~/.bashrc
Expand Down
14 changes: 9 additions & 5 deletions docker/release/cudaq.ext.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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; \
Expand Down
4 changes: 3 additions & 1 deletion docker/release/cudaq.wheel.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 .
4 changes: 3 additions & 1 deletion scripts/validate_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ echo "============================="
# Note: some of the tests do their own "!pip install ..." during the test, and
# for that to work correctly on the first time, the user site directory (e.g.
# ~/.local/lib/python3.10/site-packages) must already exist, so create it here.
mkdir -p $(python3 -m site --user-site)
if [ -x "$(command -v python3)" ]; then
mkdir -p $(python3 -m site --user-site)
fi

# Note divisive_clustering_src is not currently in the Published container under
# the "examples" folder, but the Publishing workflow moves all examples from
Expand Down
Loading