Skip to content

Commit

Permalink
Merge pull request #937 from anarkiwi/v132
Browse files Browse the repository at this point in the history
Upgrade VkFFT to 1.3.2, install Nvidia drivers on x86 for Nvidia + Vk…
  • Loading branch information
anarkiwi authored Oct 25, 2023
2 parents c455e40 + 61780f3 commit 7d0faf2
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 34 deletions.
71 changes: 40 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,37 +40,46 @@ 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.
# 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 \
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
Expand Down
21 changes: 18 additions & 3 deletions docker/Dockerfile.vkfft
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,26 @@ 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.
# 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
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
9 changes: 9 additions & 0 deletions orchestrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7d0faf2

Please sign in to comment.