Skip to content

Commit

Permalink
✨ feat(server): Add mangohud, gamescope and gamemode (#8)
Browse files Browse the repository at this point in the history
## Description

**What(what issue does this code solve/what feature does it add):**

We are adding mangohud (to show GPU usage), gamemode (for optimisations)
and gamescope (as our compositor)

**How(how does it solve it):**

1. Apt install mangohud
2. Install gamescope from flatpak
3. And then build gamemode

## Required Checklist:

- [ ] I have added any necessary documentation and comments in my code
(where appropriate)
- [ ] I have added tests to make sure my code runs in all contexts

## Further comments
  • Loading branch information
wanjohiryan authored Apr 2, 2024
1 parent 17d497e commit 198ba65
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions server.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#This contains all the necessary libs for the server to work.
#NOTE: KEEP THIS IMAGE AS LEAN AS POSSIBLE.

FROM ubuntu:22.04
FROM ubuntu:23.10

#FIXME: install Vulkan drivers (should be done in the .scripts/gpu)
#FIXME: install https://git.dec05eba.com/gpu-screen-recorder (should be done in the .scripts/stream)
Expand Down Expand Up @@ -29,19 +29,14 @@ ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8

# COPY .scripts/ /usr/bin/netris/

# RUN ls -la /usr/bin/netris \
# && chmod +x /usr/bin/netris/proton

# Expose NVIDIA libraries and paths
ENV PATH=/usr/local/nvidia/bin:${PATH} \
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}:/usr/local/nvidia/lib:/usr/local/nvidia/lib64 \
# Make all NVIDIA GPUs visible by default
NVIDIA_VISIBLE_DEVICES=all \
# All NVIDIA driver capabilities should preferably be used, check `NVIDIA_DRIVER_CAPABILITIES` inside the container if things do not work
NVIDIA_DRIVER_CAPABILITIES=all \
# Disable VSYNC for NVIDIA GPUs
# Disable VSYNC
__GL_SYNC_TO_VBLANK=0

ENV XDG_RUNTIME_DIR=/run/user/1000/ \
Expand Down Expand Up @@ -103,9 +98,42 @@ RUN apt-get update -y \
# Prepare the XDG_RUNTIME_DIR for wayland
&& mkdir -p ${XDG_RUNTIME_DIR} && chmod 0700 ${XDG_RUNTIME_DIR}

WORKDIR /tmp
#Running gamescope flatpak run org.freedesktop.Platform.VulkanLayer.gamescope
#Install Mangohud, gamemode,gpu-screen-recorder and gamescope
RUN apt-get update -y \
&& add-apt-repository -y multiverse \
&& apt-get install -y --no-install-recommends \
flatpak \
mangohud \
gamescope
# && flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo \
# && flatpak install flathub com.dec05eba.gpu_screen_recorder
#TODO: Add gamemode back in, when we get the time
# meson \
# libsystemd-dev \
# pkg-config \
# ninja-build \
# git \
# libdbus-1-dev \
# libinih-dev \
# build-essential \
# && git clone https://github.com/FeralInteractive/gamemode.git && cd gamemode \
# && git checkout 1.7 && chmod +x ./bootstrap.sh && ./bootstrap.sh \
# && gamemode -t \
# && flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo \
# gamescope
# && com.valvesoftware.Steam.Utility.gamescope
# Gamemode
# && flatpak install -y com.valvesoftware.Steam.CompatibilityTool.Proton-GE

COPY .scripts/ /usr/bin/netris/

RUN ls -la /usr/bin/netris \
&& chmod +x /usr/bin/netris/proton

#Install proton
# RUN /usr/bin/netris/proton -i
RUN /usr/bin/netris/proton -i

ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
Expand Down

0 comments on commit 198ba65

Please sign in to comment.