diff --git a/Dockerfile b/Dockerfile index acc23cf7..15a25688 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,37 +40,45 @@ ENV DEBIAN_FRONTEND noninteractive ENV UHD_IMAGES_DIR /usr/share/uhd/images ENV PATH="${PATH}:/root/.local/bin" RUN mkdir -p /data/gamutrf -RUN apt-get update && apt-get install --no-install-recommends -y -q \ - ca-certificates \ - libblas3 \ - libboost-iostreams1.74.0 \ - libboost-program-options1.74.0 \ - libboost-thread1.74.0 \ - libcairo2 \ - libev4 \ - libfftw3-3 \ - libgl1 \ - libglib2.0-0 \ - liblapack3 \ - libopencv-core4.5d \ - libopencv-imgcodecs4.5d \ - libopencv-imgproc4.5d \ - librtlsdr0 \ - libspdlog1 \ - libuhd4.1.0 \ - libunwind8 \ - libvulkan1 \ - libzmq5 \ - mesa-vulkan-drivers \ - python3 \ - python3-pyqt5 \ - python3-pyqt5.sip \ - python3-zmq \ - sox \ - sudo \ - wget \ - uhd-host \ - zstd && \ +# install nvidia's vulkan support if x86. +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 \ + ca-certificates \ + libblas3 \ + libboost-iostreams1.74.0 \ + libboost-program-options1.74.0 \ + libboost-thread1.74.0 \ + libcairo2 \ + libev4 \ + libfftw3-3 \ + libgl1 \ + libglib2.0-0 \ + liblapack3 \ + libopencv-core4.5d \ + libopencv-imgcodecs4.5d \ + libopencv-imgproc4.5d \ + librtlsdr0 \ + libspdlog1 \ + libuhd4.1.0 \ + libunwind8 \ + libvulkan1 \ + libzmq5 \ + mesa-vulkan-drivers \ + python3 \ + python3-pyqt5 \ + python3-pyqt5.sip \ + python3-zmq \ + sox \ + uhd-host \ + wget \ + zstd && \ apt-get -y -q clean && rm -rf /var/lib/apt/lists/* WORKDIR /gamutrf RUN echo "$(find /gamutrf/gamutrf -type f -name \*py -print)"|xargs grep -Eh "^(import|from)\s"|grep -Ev "gamutrf"|sort|uniq|python3 diff --git a/docker/Dockerfile.vkfft b/docker/Dockerfile.vkfft index b071ed12..febac479 100644 --- a/docker/Dockerfile.vkfft +++ b/docker/Dockerfile.vkfft @@ -8,11 +8,25 @@ 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.1 -RUN sed -i -E 's/GIT_TAG\s+"origin.main"/GIT_TAG "13.0.0"/g' VkFFT/CMakeLists.txt +RUN git clone https://github.com/DTolm/VkFFT -b v1.3.2 WORKDIR /root/VkFFT/build -RUN CMAKE_BUILD_TYPE=Release cmake .. && make -j "$(nproc)" +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. +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 COPY --from=vkfft-builder /root/VkFFT /root/VkFFT +CMD ["/root/VkFFT/build/VkFFT_TestSuite", "-devices"] + +# Test that GPU can be accessed by VkFFT: +# $ docker run --gpus all --device /dev/dri/renderD128:/dev/dri/renderD128 -ti iqtlabs/gamutrf-vkfft +# Device id: 0 name: NVIDIA GeForce RTX 4070 Ti API:1.3.260 diff --git a/orchestrator.yml b/orchestrator.yml index 04eb4d0d..ea7395ba 100644 --- a/orchestrator.yml +++ b/orchestrator.yml @@ -40,6 +40,14 @@ services: devices: - /dev/bus/usb:/dev/bus/usb - /dev/dri/renderD128:/dev/dri/renderD128 + # Uncomment when using Nvidia GPU (container toolkit etc must be installed) + #deploy: + # resources: + # reservations: + # devices: + # - driver: nvidia + # count: 1 + # capabilities: [gpu] command: - gamutrf-scan - --logaddr=0.0.0.0 @@ -51,6 +59,7 @@ services: - --nfft=256 - --sweep-sec=8 - --db_clamp_floor=-150 + - --fft_batch_size=256 healthcheck: test: [CMD, "/gamutrf/bin/scanhc.sh", "9000"] interval: 10s