netbrain / zwift

Easily zwift on linux
The Unlicense
265 stars 28 forks source link

Docker gui not showing with wayland and Fedora 38 #42

Closed cjensen506 closed 10 months ago

cjensen506 commented 11 months ago

With Wayland and Fedora 38 the container will start just fine, but the gui never pops up. No obvious error codes or stack trace. When I switch over to x11 everything works just fine. I tried removing the Wayland check and just forcing the xhost +local part of the code to run at the end, but issue persists.

Sorry I don't have more details or a solution. Not a blocker for me, but figured I would call it out.

netbrain commented 11 months ago
cjensen506 commented 11 months ago

Graphics Card: NVIDIA Corporation GP107GLM [Quadro P2000 Mobile] Kernel driver in use: nouveau Container solution: docker (same result with podman though)

Command to start container

`#!/usr/bin/env bash set -x

Set the container image to use

IMAGE=${IMAGE:-docker.io/netbrain/zwift}

The container version

VERSION=${VERSION:-latest}

CONTAINER_TOOL=docker

Check for updated container image

if [[ ! $DONT_PULL ]] then $CONTAINER_TOOL pull $IMAGE:$VERSION fi

VGA_DEVICE_FLAG="--device /dev/dri:/dev/dri"

Start the zwift container

CONTAINER=$($CONTAINER_TOOL run \ -d \ --rm \ --privileged \ -e DISPLAY=$DISPLAY \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -v /run/user/$UID/pulse:/run/user/1000/pulse \ -v zwift-$USER:/home/user/Zwift \ $([ "$CONTAINER_TOOL" = "podman" ] && echo '--userns=keep-id') \ $VGA_DEVICE_FLAG \ $IMAGE:$VERSION)

Allow container to connect to X

xhost +local:$($CONTAINER_TOOL inspect --format='{{ .Config.Hostname }}' $CONTAINER) `

netbrain commented 11 months ago

could you try to run the following command and see what you get?

# podman
podman run -it --rm --privileged -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --userns=keep-id --entrypoint=bash netbrain/zwift 
sudo apt update && sudo apt -y install mesa-utils
glxinfo | egrep "(glx)|(rendering)"
glxgears
exit

# docker
docker run -it --rm --privileged -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix  --entrypoint=bash netbrain/zwift 
sudo apt update && sudo apt -y install mesa-utils
glxinfo | egrep "(glx)|(rendering)"
glxgears
exit
netbrain commented 11 months ago

You might also have to do xhost + before running the abovementioned.

cjensen506 commented 11 months ago

Tried the docker version.

The glxinfo | egrep "(glx)|(rendering)" didn't output anything.

glxinfo by itself just outputs:

user@a294d42ac8a6:~$ glxinfo
name of display: :0

And this output from glxgears user@a294d42ac8a6:~$ glxgears X Error of failed request: BadAlloc (insufficient resources for operation) Major opcode of failed request: 147 () Minor opcode of failed request: 7 Serial number of failed request: 41 Current serial number in output stream: 43

netbrain commented 11 months ago

Since your using nouveau you might need to add --device /dev/dri:/dev/dri, not sure tho.

netbrain commented 11 months ago

But in any case if you can't get proper output from glxinfo or start glxgears, then something is wrong with the system setup.

What is your docker version? and are you running docker-desktop? There has been other users who had problems when running fedora and docker-desktop. But everything worked when installing the docker-engine

https://docs.docker.com/engine/install/fedora/

cjensen506 commented 11 months ago

seems --device is not a valid option.

(base) [chris@fedora ~]$ docker run -it --rm --privileged -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix  --entrypoint=bash netbrain/zwift --device /dev/dri:/dev/dri
bash: --device: invalid option
Usage:  bash [GNU long option] [option] ...
    bash [GNU long option] [option] script-file ...
GNU long options:
    --debug
    --debugger
    --dump-po-strings
    --dump-strings
    --help
    --init-file
    --login
    --noediting
    --noprofile
    --norc
    --posix
    --pretty-print
    --rcfile
    --restricted
    --verbose
    --version
Shell options:
    -ilrsD or -c command or -O shopt_option     (invocation only)
    -abefhkmnptuvxBCHP or -o option

I have been using docker-engine

(base) [chris@fedora ~]$ docker version
Client: Docker Engine - Community
 Version:           24.0.7
 API version:       1.43
 Go version:        go1.20.10
 Git commit:        afdd53b
 Built:             Thu Oct 26 09:09:36 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.7
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.10
  Git commit:       311b9ff
  Built:            Thu Oct 26 09:08:08 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.25
  GitCommit:        d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
 runc:
  Version:          1.1.10
  GitCommit:        v1.1.10-0-g18a0cb0
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
netbrain commented 11 months ago

--device needs to be at the start, not the end.

Before netbrain/zwift

cjensen506 commented 11 months ago

glxinfo seems to just hang on me until after a few minutes I give in and kill it.

user@26728f9912e6:~$ glxinfo
name of display: :0
^C

Also just to re-iterate. I am perfectly happy using xorg. I would only recommend spending time on this if you think it might be a systemic issue you are interested in.

netbrain commented 11 months ago

might have been related to #44 , could you check after the next build?