Commit c2cd9f52 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

feat: GPU passthrough support

feat: GPU passthrough support
parents da455592 0d2a222a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ RUN apt-get update && apt-get -y upgrade && \
	ca-certificates \
	netcat-openbsd \
	qemu-system-x86 \
	xserver-xorg-video-intel \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
    
+11 −0
Original line number Diff line number Diff line
@@ -170,6 +170,17 @@ docker run -it --rm -p 5000:5000 --device=/dev/kvm --cap-add NET_ADMIN --stop-ti

    With this method, you are able to switch between different versions while keeping your file data.

  * ### How do I passthrough my GPU?

    To enable this feature, add the following lines to your compose file:

    ```yaml
    environment:
        GPU: "Y"
    devices:
        - /dev/dri
    ```

  * ### What are the differences compared to the standard DSM?

    There are only two minor differences: the Virtual Machine Manager package is not provided, and Surveillance Station doesn't include any free licenses.
+6 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ set -Eeuo pipefail
# Docker environment variables

: ${URL:=''}            # URL of the PAT file
: ${GPU:='N'}         # Enable GPU passthrough
: ${DEBUG:='N'}         # Enable debug mode
: ${ALLOCATE:='Y'}      # Preallocate diskspace
: ${ARGUMENTS:=''}      # Extra QEMU parameters
@@ -81,6 +82,11 @@ EXTRA_OPTS="-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x4"
EXTRA_OPTS="$EXTRA_OPTS -object rng-random,id=objrng0,filename=/dev/urandom"
EXTRA_OPTS="$EXTRA_OPTS -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0,addr=0x1c"

if [[ "${GPU}" == [Yy1]* ]]; then
  DEF_OPTS="-nodefaults -boot strict=on -display egl-headless,rendernode=/dev/dri/renderD128"
  DEF_OPTS="${DEF_OPTS} -device virtio-vga,id=video0,max_outputs=1,bus=pcie.0,addr=0x1"
fi

ARGS="${DEF_OPTS} ${CPU_OPTS} ${RAM_OPTS} ${MAC_OPTS} ${MON_OPTS} ${SERIAL_OPTS} ${NET_OPTS} ${DISK_OPTS} ${EXTRA_OPTS} ${ARGUMENTS}"
ARGS=$(echo "$ARGS" | sed 's/\t/ /g' | tr -s ' ')