-
-
Notifications
You must be signed in to change notification settings - Fork 51
Upgrade to Wine 11.5 devel with EGL support and fix GPU rendering #334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,23 +21,22 @@ RUN git clone https://github.com/quietvoid/runfromprocess-rs . \ | |
|
|
||
| FROM debian:${DEBIAN_VERSION}-slim AS wine-base | ||
|
|
||
| # As at May 2024 Wayland Native works wine 9.9 or later: | ||
| # WINE_BRANCH="devel" | ||
| # For Specific version fix add WINE_VERSION, | ||
| # make sure to add "=" to the start, comment out for latest | ||
| # WINE_VERSION="=9.9~bookworm-1" | ||
| # Wine 11: EGL is the default OpenGL backend (replaced GLX since 10.17). | ||
| # Wayland native support included since 9.9. Pinned to 11.5 devel. | ||
| # To update, change WINE_VERSION (prefix with "=", omit for latest devel) | ||
| # WINE_VERSION="=11.5~${DEBIAN_VERSION}-1" | ||
| ARG DEBIAN_VERSION | ||
| ARG WINE_BRANCH="devel" | ||
| ARG WINE_VERSION="=9.9~${DEBIAN_VERSION}-1" | ||
| ARG WINETRICKS_VERSION=20240105 | ||
| ARG WINE_VERSION="=11.5~${DEBIAN_VERSION}-1" | ||
| ARG WINETRICKS_VERSION=20260125 | ||
|
|
||
| # Install prerequisites | ||
| # - ca-certificates for wget and curl | ||
| # - curl used in zwift authentication script | ||
| # - gamemode for freedesktop screensaver inhibit | ||
| # - gosu for invoking scripts in entrypoint | ||
| # - libegl1 and libgl1 for GL library | ||
| # - libvulkan1 for vulkan loader library | ||
| # - libegl1/libgl1 and i386 variants for GL/EGL library | ||
| # - libvulkan1 and i386 variant for vulkan loader library | ||
| # - procps for pgrep | ||
| # - sudo for normal user installation | ||
| # - wget for downloading winehq key | ||
|
|
@@ -51,8 +50,11 @@ RUN dpkg --add-architecture i386 \ | |
| gamemode \ | ||
| gosu \ | ||
| libegl1 \ | ||
| libegl1:i386 \ | ||
| libgl1 \ | ||
| libgl1:i386 \ | ||
| libvulkan1 \ | ||
| libvulkan1:i386 \ | ||
| procps \ | ||
| sudo \ | ||
| wget \ | ||
|
|
@@ -75,11 +77,17 @@ RUN wget -qO /etc/apt/trusted.gpg.d/winehq.asc https://dl.winehq.org/wine-builds | |
| && chmod +x /usr/local/bin/winetricks | ||
|
|
||
| # Create passwordless user and make nvidia libraries discoverable | ||
| # Register NVIDIA as a GLVND EGL vendor so the dispatcher loads libEGL_nvidia.so.0 | ||
| # when injected by the NVIDIA container runtime. Harmless if NVIDIA is absent | ||
| # (GLVND silently skips vendors whose library is not found). | ||
| RUN adduser --disabled-password --gecos '' user \ | ||
| && adduser user sudo \ | ||
| && echo '%SUDO ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \ | ||
| && echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf \ | ||
| && echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf | ||
| && echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf \ | ||
| && mkdir -p /usr/share/glvnd/egl_vendor.d \ | ||
| && printf '{"file_format_version":"1.0.0","ICD":{"library_path":"libEGL_nvidia.so.0"}}\n' \ | ||
| > /usr/share/glvnd/egl_vendor.d/10_nvidia.json | ||
|
Comment on lines
+88
to
+90
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you need to add the 10_nvidia.json file? It already exists in the container for me (tried with both docker and podman), I'm guessing this is something the nvidia container toolkit does. user@glenn-main-pc:/$ ls /usr/share/glvnd/egl_vendor.d/
10_nvidia.json 50_mesa.json
user@glenn-main-pc:/$ cat /usr/share/glvnd/egl_vendor.d/10_nvidia.json
{
"file_format_version" : "1.0.0",
"ICD" : {
"library_path" : "libEGL_nvidia.so.0"
}
} |
||
|
|
||
| # Required for non-glvnd setups | ||
| ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu:/usr/local/nvidia/lib:/usr/local/nvidia/lib64 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,7 +142,7 @@ if [[ ${CONTAINER_TOOL} == "docker" ]]; then | |
| # This avoids a costly recursive find on every normal startup | ||
| local target="${1:?}" | ||
| local result | ||
| [[ -d ${target} ]] && result="$(find "${target}" -maxdepth 0 \( ! -user user -o ! -group user \) -print 2> /dev/null)" && [[ -n ${result} ]] | ||
| [[ -d ${target} ]] && result="$(find "${target}" -maxdepth 1 \( ! -user user -o ! -group user \) -print 2> /dev/null)" && [[ -n ${result} ]] | ||
| } | ||
|
|
||
| update_ownership() { | ||
|
|
@@ -181,7 +181,25 @@ if [[ ${CONTAINER_TOOL} == "docker" ]]; then | |
| exit 1 | ||
| fi | ||
|
|
||
| startup_cmd=(gosu user:user "${startup_cmd[@]}") | ||
| # Add DRI render group to user so gosu preserves GPU access. | ||
| # gosu sets supplementary groups from /etc/group, not from Docker's --group-add, | ||
| # so we must register the DRI device's GID in the container before dropping privileges. | ||
| # Note: do not use groupadd -f (silently no-ops if group name exists with different GID). | ||
| if [[ -d /dev/dri ]]; then | ||
| dri_gid="$(stat -c '%g' /dev/dri/renderD128 2>/dev/null || stat -c '%g' /dev/dri/card0 2>/dev/null || true)" | ||
| if [[ -n ${dri_gid} ]]; then | ||
| if ! getent group "${dri_gid}" > /dev/null 2>&1; then | ||
| groupadd -g "${dri_gid}" dri_render 2>/dev/null || true | ||
| fi | ||
| dri_group="$(getent group "${dri_gid}" | cut -d: -f1)" | ||
| if [[ -n ${dri_group} ]]; then | ||
| usermod -aG "${dri_group}" user 2>/dev/null || true | ||
| msgbox info "Added user to ${dri_group} group (gid=${dri_gid}) for DRI access" | ||
| fi | ||
| fi | ||
| fi | ||
|
Comment on lines
+184
to
+200
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What issue is this trying to fix? Graphics card access already worked? It does not change anything for me for egl On my machine (fedora 43), the card and render devices belong to a different group: $ ls -al /dev/dri
total 0
drwxr-xr-x. 3 root root 100 23 mrt 09:23 .
drwxr-xr-x. 21 root root 4960 23 mrt 09:23 ..
drwxr-xr-x. 2 root root 100 23 mrt 09:23 by-path
crw-rw----+ 1 root video 226, 1 23 mrt 09:23 card1
crw-rw-rw-. 1 root render 226, 128 23 mrt 09:23 renderD128And the card is /dev/dri/card1, so we shouldn't assume it's card0?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With docker, if I add the user to the group from /dev/dri/card1 and launch with gosu user instead of gosu user:user, the permission denied warning goes away. But the other warning remains and it still uses software rendering instead of hardware rendering. |
||
|
|
||
| startup_cmd=(gosu user "${startup_cmd[@]}") | ||
| fi | ||
|
|
||
| ######################################### | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -137,10 +137,9 @@ install_zwift() { | |
| msgbox info "Installing prerequisites using winetricks" | ||
| winetricks -q dotnet20 dotnet48 d3dcompiler_47 || return 1 | ||
|
|
||
| # download and install webview 2 | ||
| msgbox info "Downloading and installing webview2" | ||
| wget -O webview2-setup.exe https://go.microsoft.com/fwlink/p/?LinkId=2124703 || return 1 | ||
| wine webview2-setup.exe /silent /install || return 1 | ||
| # WebView2 install skipped: both bootstrapper and standalone require the | ||
| # MicrosoftEdgeUpdate COM service which Wine cannot activate. SilentLaunch | ||
| # bypasses the launcher UI so WebView2 is not needed at runtime. | ||
|
Comment on lines
+140
to
+142
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This appears to be a specific issue with wine 11.5. It still worked with wine 11.3. But if we don't need webview2, we might indeed as well remove it. |
||
|
|
||
| # enable Wayland support, requires DISPLAY to be blank to use Wayland | ||
| msgbox info "Enabling Wayland support" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add the 32-bit libraries? They're not needed?