🐛 fix(base): Device selection patch for gpu-screen-recorder (#93)

## Description

Adds new `-device` argument for gpu-screen-recorder which allows
specifying a GPU to use (by `/dev/dri/cardN` path)

This fixes an issue with multi-gpu systems when device such as
`/dev/dri/card1` is passed through but gpu-screen-recorder will still
try to access `/dev/dri/card0` for capturing and failing.

Added relevant bits to `gpu_helpers.sh` to find the card path - I assume
all modern modesetting drivers will have a `/drm/` path that tells the
card number. If not, the script will fall back to gpu-screen-recorder's
own method of finding the card.

Edit: Forgot to mention patches are now copied to /tmp/ rather than
/etc/

Co-authored-by: Kristian Ollikainen <DatCaptainHorse@users.noreply.github.com>
This commit is contained in:
Kristian Ollikainen
2024-07-07 12:43:58 +03:00
committed by GitHub
parent cf69f6c93a
commit 3df53e7e38
4 changed files with 70 additions and 3 deletions

View File

@@ -203,7 +203,7 @@ ENV \
# Disable VSYNC for NVIDIA GPUs
__GL_SYNC_TO_VBLANK=0
COPY .patches /etc/
COPY .patches /tmp/
#Build and install gpu-screen-recorder
RUN apt-get update -y \
@@ -259,7 +259,7 @@ RUN apt-get update -y \
&& find . -maxdepth 1 -type f -name "*libnvrtc.so.*" -exec sh -c 'ln -snf $(basename {}) libnvrtc.so' \; \
&& mkdir -p /usr/local/nvidia/lib && mv -f libnvrtc* /usr/local/nvidia/lib \
&& git clone https://repo.dec05eba.com/gpu-screen-recorder && cd gpu-screen-recorder \
&& git apply /etc/connectcheckskip.patch \
&& git apply /tmp/connectcheckskip.patch && git apply /tmp/devicearg.patch \
&& meson setup build \
&& meson configure --prefix=/usr --buildtype=release -Dsystemd=true -Dstrip=true build \
&& ninja -C build install