diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 32692f64..66dddbba 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v4 - name: docker build run: | - docker build -f docker/Dockerfile.vkfft docker -t iqtlabs/gamutrf-vkfft:latest + docker build -f docker/Dockerfile.vkfft . -t iqtlabs/gamutrf-vkfft:latest docker build -f docker/Dockerfile.driver docker -t iqtlabs/gamutrf-driver:latest docker build -f docker/Dockerfile.uhd-sr docker -t iqtlabs/gamutrf-uhd-sr:latest docker build -f docker/Dockerfile.base docker -t iqtlabs/gamutrf-base:latest diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 07d8a0b8..5610057d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -34,7 +34,7 @@ jobs: - name: Build and push platforms vkfft uses: docker/build-push-action@v5 with: - context: docker + context: . file: docker/Dockerfile.vkfft platforms: linux/amd64,linux/arm64 push: true diff --git a/Dockerfile b/Dockerfile index 12060ba5..67e44ce1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,17 +49,12 @@ LABEL maintainer="Charlie Lewis " ENV DEBIAN_FRONTEND noninteractive ENV UHD_IMAGES_DIR /usr/share/uhd/images ENV PATH="${PATH}:/root/.local/bin" +WORKDIR /root +COPY bin/install-nv.sh /root RUN mkdir -p /data/gamutrf # install nvidia's vulkan support if x86. # hadolint ignore=DL3008 -RUN if [ "$(arch)" = "x86_64" ] ; then \ - apt-get update && \ - apt-get install -y --no-install-recommends ca-certificates dirmngr gpg-agent gpg wget && \ - apt-key adv --fetch-keys "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/$(arch)/3bf863cc.pub" && \ - echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/$(arch)/ /" | tee /etc/apt/sources.list.d/nvidia.list && \ - apt-get update && \ - apt-get install -y --no-install-recommends libnvidia-gl-550 ; \ - fi && \ +RUN if [ "$(arch)" = "x86_64" ] ; then /root/install-nv.sh ; fi && \ apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ libblas3 \ diff --git a/bin/install-nv.sh b/bin/install-nv.sh new file mode 100755 index 00000000..78a9a20c --- /dev/null +++ b/bin/install-nv.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e +apt-get update && \ + apt-get install -y --no-install-recommends ca-certificates dirmngr gpg-agent gpg wget && \ + apt-key adv --fetch-keys "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/$(arch)/3bf863cc.pub" && \ + echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/$(arch)/ /" | tee /etc/apt/sources.list.d/nvidia.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends libnvidia-gl-550 diff --git a/docker/Dockerfile.vkfft b/docker/Dockerfile.vkfft index c373d5e7..bce8641f 100644 --- a/docker/Dockerfile.vkfft +++ b/docker/Dockerfile.vkfft @@ -8,23 +8,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libvulkan-dev \ python3-dev WORKDIR /root -RUN git clone https://github.com/DTolm/VkFFT -b v1.3.3 +RUN git clone https://github.com/DTolm/VkFFT -b v1.3.4 WORKDIR /root/VkFFT/build RUN CMAKE_BUILD_TYPE=Release cmake -DGLSLANG_GIT_TAG=13.0.0 .. && make -j "$(nproc)" FROM ubuntu:22.04 # TODO: ideally, should be packaged such that cmake can find it. # hadolint ignore=DL3008 -RUN if [ "$(arch)" = "x86_64" ] ; then \ - apt-get update && \ - apt-get install -y --no-install-recommends ca-certificates dirmngr gpg-agent gpg wget && \ - apt-key adv --fetch-keys "https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/$(arch)/3bf863cc.pub" && \ - echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/$(arch)/ /" | tee /etc/apt/sources.list.d/nvidia.list && \ - apt-get update && \ - apt-get install -y --no-install-recommends libnvidia-gl-545 ; \ - fi && \ - apt-get update && apt-get install -y --no-install-recommends \ - libvulkan1 +WORKDIR /root +COPY bin/install-nv.sh /root +RUN if [ "$(arch)" = "x86_64" ] ; then /root/install-nv.sh ; fi && \ + apt-get update && apt-get install -y --no-install-recommends libvulkan1 COPY --from=vkfft-builder /root/VkFFT /root/VkFFT CMD ["/root/VkFFT/build/VkFFT_TestSuite", "-devices"]