From 18f4540fc6a526a95303bb75c6a45f0a0780c7df Mon Sep 17 00:00:00 2001 From: Pravek Sharma Date: Mon, 20 Jan 2025 16:49:23 -0500 Subject: [PATCH 1/3] Update ubuntu-latest to install nvcc Signed-off-by: Pravek Sharma --- ubuntu-latest/Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ubuntu-latest/Dockerfile b/ubuntu-latest/Dockerfile index f07656f..3d3ab9c 100644 --- a/ubuntu-latest/Dockerfile +++ b/ubuntu-latest/Dockerfile @@ -73,5 +73,15 @@ RUN opam init --yes --auto-setup && opam install --confirm-level=unsafe-yes --de # install ajv for CBOM validation RUN npm -g install ajv ajv-cli +# install nvcc for building with OQS_USE_CUPQC=ON +RUN apt-key del 7fa2af80 && \ + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb && \ + dpkg -i cuda-keyring_1.1-1_all.deb && \ + apt-get update && \ + apt-get install -y cuda-toolkit && \ + echo PATH=/usr/local/cuda-12.6/bin${PATH:+:${PATH}} >> .bashrc && \ + echo LD_LIBRARY_PATH=/usr/local/cuda-12.6/lib64 \ + ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} >> .bashrc + # Activate if we want to test specific OpenSSL3 versions: # RUN cd /root && git clone --depth 1 --branch openssl-3.0.7 https://github.com/openssl/openssl.git && cd openssl && LDFLAGS="-Wl,-rpath -Wl,/usr/local/openssl3/lib64" ./config --prefix=/usr/local/openssl3 && make -j && make install \ No newline at end of file From e5ba8d628e3b3b83a243d6810c24790b59b1a415 Mon Sep 17 00:00:00 2001 From: Pravek Sharma Date: Mon, 20 Jan 2025 17:17:11 -0500 Subject: [PATCH 2/3] fixup! Update ubuntu-latest to install nvcc Signed-off-by: Pravek Sharma --- ubuntu-latest/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ubuntu-latest/Dockerfile b/ubuntu-latest/Dockerfile index 3d3ab9c..65a9d49 100644 --- a/ubuntu-latest/Dockerfile +++ b/ubuntu-latest/Dockerfile @@ -83,5 +83,10 @@ RUN apt-key del 7fa2af80 && \ echo LD_LIBRARY_PATH=/usr/local/cuda-12.6/lib64 \ ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} >> .bashrc +RUN wget https://developer.download.nvidia.com/compute/cupqc/redist/cupqc/cupqc-pkg-0.2.0.tar.gz && \ + mkdir /cupqc && \ + tar -xzvf cupqc-pkg-0.2.0.tar.gz -C /cupqc && \ + echo cuPQC_DIR="/cupqc/cupqc/cupqc-pkg-0.2.0/cmake/" >> .bashrc + # Activate if we want to test specific OpenSSL3 versions: # RUN cd /root && git clone --depth 1 --branch openssl-3.0.7 https://github.com/openssl/openssl.git && cd openssl && LDFLAGS="-Wl,-rpath -Wl,/usr/local/openssl3/lib64" ./config --prefix=/usr/local/openssl3 && make -j && make install \ No newline at end of file From cf63f1dd142e9de4191bc655e1aa954f86c3f386 Mon Sep 17 00:00:00 2001 From: Pravek Sharma Date: Tue, 21 Jan 2025 17:05:44 -0500 Subject: [PATCH 3/3] Update ubuntu-latest to only install nvcc when ARCH=x86_64 Signed-off-by: Pravek Sharma --- ubuntu-latest/Dockerfile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ubuntu-latest/Dockerfile b/ubuntu-latest/Dockerfile index 65a9d49..0f810c5 100644 --- a/ubuntu-latest/Dockerfile +++ b/ubuntu-latest/Dockerfile @@ -16,6 +16,9 @@ FROM ubuntu:latest WORKDIR /root COPY --from=build /usr/local/bin/actionlint /usr/local/bin/actionlint +ARG ARCH +ENV ARCH=${ARCH} + RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Zurich && \ ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ echo $TZ > /etc/timezone && \ @@ -73,20 +76,21 @@ RUN opam init --yes --auto-setup && opam install --confirm-level=unsafe-yes --de # install ajv for CBOM validation RUN npm -g install ajv ajv-cli -# install nvcc for building with OQS_USE_CUPQC=ON -RUN apt-key del 7fa2af80 && \ +# install nvcc for building with OQS_USE_CUPQC=ON on x86_64 +RUN if [ "$ARCH" = "x86_64" ]; then \ + apt-key del 7fa2af80 && \ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb && \ dpkg -i cuda-keyring_1.1-1_all.deb && \ apt-get update && \ apt-get install -y cuda-toolkit && \ echo PATH=/usr/local/cuda-12.6/bin${PATH:+:${PATH}} >> .bashrc && \ echo LD_LIBRARY_PATH=/usr/local/cuda-12.6/lib64 \ - ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} >> .bashrc - -RUN wget https://developer.download.nvidia.com/compute/cupqc/redist/cupqc/cupqc-pkg-0.2.0.tar.gz && \ + ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} >> .bashrc && \ + wget https://developer.download.nvidia.com/compute/cupqc/redist/cupqc/cupqc-pkg-0.2.0.tar.gz && \ mkdir /cupqc && \ tar -xzvf cupqc-pkg-0.2.0.tar.gz -C /cupqc && \ - echo cuPQC_DIR="/cupqc/cupqc/cupqc-pkg-0.2.0/cmake/" >> .bashrc + echo cuPQC_DIR="/cupqc/cupqc/cupqc-pkg-0.2.0/cmake/" >> .bashrc; \ + fi # Activate if we want to test specific OpenSSL3 versions: # RUN cd /root && git clone --depth 1 --branch openssl-3.0.7 https://github.com/openssl/openssl.git && cd openssl && LDFLAGS="-Wl,-rpath -Wl,/usr/local/openssl3/lib64" ./config --prefix=/usr/local/openssl3 && make -j && make install \ No newline at end of file