NVIDIA / open-gpu-kernel-modules

NVIDIA Linux open GPU kernel module source
Other
14.18k stars 1.18k forks source link

Pipewire screen sharing under Wayland results in black canvas with cursors #467

Open kotatsuyaki opened 1 year ago

kotatsuyaki commented 1 year ago

NVIDIA Open GPU Kernel Modules Version

525.89.02

Does this happen with the proprietary driver (of the same version) as well?

Yes

Operating System and Version

NixOS (Nixpkgs commit 806075b)

Kernel Release

6.1.13

Hardware: GPU

NVIDIA GeForce RTX 3070

Describe the bug

When using Pipewire screen sharing on Chromium or Firefox on Wayland, the shared stream is black, with the cursor visible and moving. Here's a screenshot of it.

Screenshot 2023-02-26 at 22-37-17 WebRTC Screen Sharing Plugin-free

This bug was reported to Pipewire. All affected users are using the proprietary Nvidia driver, and the bug is reproducible with the open kernel module.

Note that while on Chromium and Firefox the results were black, I was able to record the screen with OBS Studio, so it's unclear whether this bug belongs to here.

To Reproduce

  1. Open Chromium or Firefox.
  2. Open any website that uses WebRTC screen sharing (tested on https://www.webrtc-experiment.com) and share the screen.
  3. From the xdg-desktop-portal popup dialog, select the entire screen.

Bug Incidence

Always

nvidia-bug-report.log.gz

Due to Nixpkgs missing the nvidia-bug-report.sh script (NixOS/nixpkgs#172739), this part is left out.

More Info

No response

ar-nadeem commented 1 year ago

Adding more info about the bug.

The bug happens when using Wayland, screen share on OBS works fine. But on WebRTC only black screen with cursor moving around.

Chrome Debug on sharing with WebRTC (when launched from the terminal):

[15568:15568:0128/011017.290397:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is egl, ANGLE is
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to open nvidia-drm: /usr/lib/dri/nvidia-drm_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
failed to load driver: nvidia-drm
MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
failed to load driver: zink
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
failed to load swrast driver
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to open nvidia-drm: /usr/lib/dri/nvidia-drm_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
failed to load driver: nvidia-drm
MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
failed to load driver: zink
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
failed to load swrast driver

Journalctl from when I start to share screen.

Jan 28 01:23:39 archlinux xdg-desktop-portal-kde[2638]: start streaming Stream(QMap(("size", QVariant(QSize, QSize(1920, 1080)))("source_type", QVariant(uint, 1))), 102) QPoint(0,0)
Jan 28 01:23:39 archlinux wireplumber[2738]: <WpPortalPermissionStorePlugin:0x563b85ea76a0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
Jan 28 01:23:39 archlinux kded5[2562]: Registering ":1.311/StatusNotifierItem" to system tray
Jan 28 01:23:40 archlinux plasmashell[2588]: file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/FullRepresentation.qml:183:13: QML DescriptiveLabel: Binding loop detected for pr>
Jan 28 01:23:40 archlinux kded5[2562]: Service  ":1.311" unregistered
Jan 28 01:23:40 archlinux plasmashell[2588]: org.kde.plasma.libtaskmanager: Got invalid activation app_id: ""
Jan 28 01:23:40 archlinux xdg-desktop-portal-kde[2638]: start streaming Stream(QMap(("size", QVariant(QSize, QSize(1920, 1080)))("source_type", QVariant(uint, 1))), 102) QPoint(0,0)
Jan 28 01:23:40 archlinux kded5[2562]: Registering ":1.313/StatusNotifierItem" to system tray
Jan 28 01:23:40 archlinux wireplumber[2738]: <WpPortalPermissionStorePlugin:0x563b85ea76a0> Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera
Jan 28 01:23:45 archlinux plasmashell[2588]: file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/FullRepresentation.qml:183:13: QML DescriptiveLabel: Binding loop detected for pr>
Jan 28 01:23:45 archlinux kded5[2562]: Service  ":1.313" unregistered

My printenv result (username replaced with USER)

ALACRITTY_LOG=/tmp/Alacritty-28525.log
ALACRITTY_SOCKET=/run/user/1000/Alacritty-wayland-0-28525.sock
ALACRITTY_WINDOW_ID=94285320106864
COLORTERM=truecolor
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DEBUGINFOD_URLS=https://debuginfod.archlinux.org
DESKTOP_SESSION=plasmawayland
DISPLAY=:1
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/USER/.gtkrc-2.0:/home/USER/.config/gtkrc-2.0
GTK_RC_FILES=/etc/gtk/gtkrc:/home/USER/.gtkrc:/home/USER/.config/gtkrc
HOME=/home/USER
INVOCATION_ID=76c335a647f9419a9c043a9b00d07e96
JOURNAL_STREAM=8:48051
KDE_APPLICATIONS_AS_SCOPE=1
KDE_FULL_SESSION=true
KDE_SESSION_UID=1000
KDE_SESSION_VERSION=5
LANG=en_US.UTF-8
LOGNAME=USER
MAIL=/var/spool/mail/USER
MANAGERPID=2449
MOTD_SHOWN=pam
OLDPWD=/home/USER
PAM_KWALLET5_LOGIN=/run/user/1000/kwallet5.socket
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
PLASMA_USE_QT_SCALING=1
PWD=/home/USER
QSG_RENDER_LOOP=basic
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_WAYLAND_FORCE_DPI=96
SESSION_MANAGER=local/archlinux:@/tmp/.ICE-unix/2560,unix/archlinux:/tmp/.ICE-unix/2560
SHELL=/usr/bin/zsh
SHLVL=1
SYSTEMD_EXEC_PID=2588
TERM=alacritty
USER=USER
WAYLAND_DISPLAY=wayland-0
WINDOWID=94285320106864
XAUTHORITY=/run/user/1000/xauth_WpXLZU
XCURSOR_SIZE=24
XCURSOR_THEME=breeze_cursors
XDG_ACTIVATION_TOKEN=kwin-129
XDG_CONFIG_DIRS=/home/USER/.config/kdedefaults:/etc/xdg
XDG_CURRENT_DESKTOP=KDE
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=KDE
XDG_SESSION_ID=5
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session3
XDG_SESSION_TYPE=wayland
XDG_VTNR=2
ZSH=/home/USER/.oh-my-zsh
PAGER=less
LESS=-R
LSCOLORS=Gxfxcxdxbxegedabagacad
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.swp=00;90:*.tmp=00;90:*.dpkg-dist=00;90:*.dpkg-old=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:
_=/usr/bin/printenv
Cylon-interrogator commented 1 year ago

I have the same issue. It happens only with NVidia GPU, my other PC with AMD works fine. It happens with 530 beta driver as well, both proprietary and open one.

GrabbenD commented 1 year ago

Same issue here!

otacke commented 1 year ago

Not sure if this helps, but I am in the same situation: black screen and only mouse pointer visible when sharing the screen on Wayland.

Kernel: 6.2.6-1-default x86_64

VGA compatible controller [0300]: NVIDIA Corporation TU117 [GeForce GTX 1650] [10de:1f82] (rev a1)
    Subsystem: NVIDIA Corporation TU117 [GeForce GTX 1650] [10de:1f82]
    Kernel driver in use: nouveau
otacke commented 1 year ago

I fixed the issue for me.

VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] (rev c5)
ayoubedd commented 1 year ago

I fixed the issue for me.

VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] (rev c5)

How ?

otacke commented 1 year ago

@ayoubedd I replaced the NVIDIA card with an ATI board ;-) I've had other trouble with NVIDIA before, so I thought it might be time for a change eventually.

Cylon-interrogator commented 1 year ago

I absolutely agree, Nvidia just sucks on Linux. However, I've got ton of NVidia GPUs lying around left over from 2021 crypto craze waiting for the next bull run, and I've put one of the to my secondary rig in my second home ... At least, now when they've opened the drivers, there is hope for the future ...

ar-nadeem commented 1 year ago

Leaving Nvidia is not a choice for me. AI, Cuda, and other software implementations of Nvidia are of great use to me. Nvidia wants nothing to do with Linux. The bare minimum drivers with billion of bugs are all they do. This might change because of Steam Deck, why wouldn't Nvidia want their GPU in the steam deck instead of AMDs? But for now, I shifted back to Windows.

nikzasel commented 1 year ago

Problem still occurs on 530.41.03-1

I have KDE 5.27.5-1 and kwin 5.27.5-2 and have partially (can share windows, but not whole screen) made screen sharing working by:

  1. Install xwaylandvideobridge. You need it to stream wayland windows to x11 apps (like to screenshare in discord or telegram, you dont need it for wayland window to wayland app streaming)
  2. Add following string to ~/.profile file to use glx instead of egl backend.
    #O2: OpenGL 2 backend
    #O2ES: OpenGL ES 2 backend (since 5.5)
    export KWIN_COMPOSE=O2
  3. (optional) Remove if set --use-gl=egl flag from browser launch flags to fix GPU acceleration.

I think you can fix it for other window manager if you somehow make make them not work with egl

I think recent NVIDIA driver have somehow broke OpenGL ES because if i fetch info about it via eglinfo -B i receive:

GBM platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
corrupted size vs. prev_size
fish: Job 1, 'eglinfo -B' terminated by signal SIGABRT (Abort)

and following entry in journal:

Stack trace of thread 65909:
#0  0x00007f2eef60526c n/a (libc.so.6 + 0x8926c)
#1  0x00007f2eef5b5a08 raise (libc.so.6 + 0x39a08)
#2  0x00007f2eef59e538 abort (libc.so.6 + 0x22538)
#3  0x00007f2eef59f2db n/a (libc.so.6 + 0x232db)
#4  0x00007f2eef60f1b7 n/a (libc.so.6 + 0x931b7)
#5  0x00007f2eef60fcce n/a (libc.so.6 + 0x93cce)
#6  0x00007f2eef60fe40 n/a (libc.so.6 + 0x93e40)
#7  0x00007f2eef6124b8 n/a (libc.so.6 + 0x964b8)
#8  0x00007f2eef61382a malloc (libc.so.6 + 0x9782a)
#9  0x00007f2eed696155 n/a (libnvidia-eglcore.so.530.41.03 + 0x1496155)
#10 0x00007f2eed689bfd n/a (libnvidia-eglcore.so.530.41.03 + 0x1489bfd)
#11 0x00007f2eed68a91c n/a (libnvidia-eglcore.so.530.41.03 + 0x148a91c)
#12 0x00007f2eed68aa3c n/a (libnvidia-eglcore.so.530.41.03 + 0x148aa3c)
#13 0x00007f2eed6a457b n/a (libnvidia-eglcore.so.530.41.03 + 0x14a457b)
#14 0x00007f2eed6a4700 n/a (libnvidia-eglcore.so.530.41.03 + 0x14a4700)
#15 0x00007f2eef042d12 n/a (libEGL_nvidia.so.0 + 0x42d12)
#16 0x00007f2eef048344 n/a (libEGL_nvidia.so.0 + 0x48344)
#17 0x00005604a1407823 n/a (eglinfo + 0x8823)
#18 0x00005604a140b3a5 n/a (eglinfo + 0xc3a5)
#19 0x00005604a140326e n/a (eglinfo + 0x426e)
#20 0x00007f2eef59f850 n/a (libc.so.6 + 0x23850)
#21 0x00007f2eef59f90a __libc_start_main (libc.so.6 + 0x2390a)
#22 0x00005604a14036e5 n/a (eglinfo + 0x46e5)
ELF object binary architecture: AMD x86-64

But for glxinfo -B i receive:

name of display: :1
display: :1  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 24564 MB
    Total available memory: 24564 MB
    Currently available dedicated video memory: 23235 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 4090/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 530.41.03
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 530.41.03
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 530.41.03
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
damnkrat commented 1 year ago

I have KDE 5.27.5-1 and kwin 5.27.5-2 and have partially (can share windows, but not whole screen) made screen sharing working by:

Install xwaylandvideobridge. You need it to stream wayland windows to x11 apps (like to screenshare in discord or telegram, you dont need it for wayland window to wayland app streaming) Add following string to ~/.profile file to use glx instead of egl backend.

O2: OpenGL 2 backend

O2ES: OpenGL ES 2 backend (since 5.5)

export KWIN_COMPOSE=O2

(optional) Remove if set --use-gl=egl flag from browser launch flags to fix GPU acceleration.

I think you can fix it for other window manager if you somehow make make them not work with egl

No changes in telegram screen sharing on KDE Plasma 5.27.4 and 5.27.5, NVIDIA dkms 530.41.03-4, RTX 3060. But I experience same bug with eglinfo and glxinfo commands.

ar-nadeem commented 1 year ago

Soo still not fixed? Are we sure the problem is with the drivers not playing nice with Wayland screen-sharing policies?

rwiggins commented 1 year ago

The problem in https://github.com/NVIDIA/open-gpu-kernel-modules/issues/467#issuecomment-1544340511 still occurs for me with version 535.54.03.

 ~ % eglinfo -B
GBM platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
corrupted size vs. prev_size
[1]    178090 IOT instruction (core dumped)  eglinfo -B
 ~ % glxinfo -B
name of display: :1
display: :1  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 24564 MB
    Total available memory: 24564 MB
    Currently available dedicated video memory: 20202 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 4090/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 535.54.03
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 535.54.03
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 535.54.03
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
 ~ % uname -a
Linux kryptos 6.4.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 01 Jul 2023 16:17:21 +0000 x86_64 GNU/Linux

I can share the core dump with NVIDIA if it's helpful.

Core was generated by `eglinfo -B'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
Downloading source file /usr/src/debug/glibc/glibc/nptl/pthread_kill.c
44            return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;                                                        
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007fc2495042d3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007fc2494b4a08 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fc24949d538 in __GI_abort () at abort.c:79
#4  0x00007fc24949e2db in __libc_message (fmt=fmt@entry=0x7fc249618515 "%s\n") at ../sysdeps/posix/libc_fatal.c:150
#5  0x00007fc24950e1b7 in malloc_printerr (str=str@entry=0x7fc249615f79 "corrupted size vs. prev_size") at malloc.c:5651
#6  0x00007fc24950ecce in unlink_chunk (p=<optimized out>, av=<optimized out>) at malloc.c:1605
#7  0x00007fc24950ee40 in malloc_consolidate (av=av@entry=0x7fc249656ba0 <main_arena>) at malloc.c:4766
#8  0x00007fc2495114b8 in _int_malloc (av=av@entry=0x7fc249656ba0 <main_arena>, bytes=1472) at malloc.c:3951
#9  0x00007fc24951282a in __GI___libc_malloc (bytes=<optimized out>) at malloc.c:3297
#10 0x00007fc247530825 in ?? () from /usr/lib/libnvidia-eglcore.so.535.54.03
#11 0x00007fc2475241ed in ?? () from /usr/lib/libnvidia-eglcore.so.535.54.03
#12 0x00007fc247524f3c in ?? () from /usr/lib/libnvidia-eglcore.so.535.54.03
#13 0x00007fc24752505c in ?? () from /usr/lib/libnvidia-eglcore.so.535.54.03
#14 0x00007fc24753eeeb in ?? () from /usr/lib/libnvidia-eglcore.so.535.54.03
#15 0x00007fc24753f070 in ?? () from /usr/lib/libnvidia-eglcore.so.535.54.03
#16 0x00007fc249042f72 in ?? () from /usr/lib/libEGL_nvidia.so.0
#17 0x00007fc2490485a4 in ?? () from /usr/lib/libEGL_nvidia.so.0
#18 0x0000558fabdaf823 in createEGLContext (d=d@entry=0x558fad65ab00, conf=conf@entry=0xcaf32c, api=api@entry=12450, 
    khr_create_context=khr_create_context@entry=1, core_profile=core_profile@entry=1, context_version=context_version@entry=0x7ffdb30e24ac)
    at ../mesa-demos-9.0.0/src/egl/opengl/eglinfo.c:436
#19 0x0000558fabdb33a5 in doOneDisplay (d=0x558fad65ab00, name=<optimized out>, opts=...) at ../mesa-demos-9.0.0/src/egl/opengl/eglinfo.c:575
#20 0x0000558fabdab26e in main (argc=<optimized out>, argv=<optimized out>) at ../mesa-demos-9.0.0/src/egl/opengl/eglinfo.c:850
(gdb) i threads
  Id   Target Id                          Frame 
* 1    Thread 0x7fc2493c0740 (LWP 178090) __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0)
    at pthread_kill.c:44

I suspect this may be the cause of a crash I'm getting when launching a different program, but it's hard for me to say for sure.

ar-nadeem commented 11 months ago

Is this Fixed ? This is the only thing stopping me from shifting to Linux from Windows.

GrabbenD commented 11 months ago

I fixed all of my Wayland- and hardware acceleration issues by switching my GPU to AMD @ar-nadeem Don't bother using hardware which gets minimal support on Linux

Cylon-interrogator commented 11 months ago

I fixed all of my Wayland- and hardware acceleration issues by switching my GPU to AMD @ar-nadeem Don't bother using hardware which gets minimal support on Linux

That's just like when you ask how to fix an issue with a game under Linux and someone replies: "Dude, just use Windows!" ... Why haven't we thought of that, I wonder ... Anyhow, I don't think that's very helpful answer. Yes, everybody knows that Nvidia (still!) sucks under Linux, although it has improved a lot during last year (as corroborated by various Linux users). Some people still prefer or need to use Nvidia for various reasons - better ray tracing support, CUDA, DLSS ... I personally use it on my secondary rig (my primary PC has RX 6700XT inside) because, I've got a lot of Nvidia GPUs lying around from 2021 crypto bull run ... also, there is not that many laptops with AMD GPUs, not even in those that are supposed to be tailored to Linux, like Tuxedo, so there is that ...

GrabbenD commented 11 months ago

Dude, just use Windows

Not a fair comparison.. We can't fix issues in Windows We can't fix issues with hardware behind closed binary blobs

everybody knows that Nvidia (still!) sucks although it has improved a lot during last year (as corroborated by various Linux users).

Yes, they have sucked for the past decade We shouldn't expect too much from a multi billion dollar comapny small company like NVDIA though 🙂

Don't support evil companies Vote with your wallet

regalialong commented 11 months ago

@GrabbenD

Yes, they have sucked for the past decade We shouldn't expect too much from a ~multi billion dollar comapny~ [sic] small company like NVDIA though

Do you know how multi billion dollar companies stay billion dollar companies? They don't throw money into things that they think won't bring them money back.

Reality is that the crowd running Nvidia on Linux, followed by the crowd that runs Wayland is pretty small (although steadily growing). I also dislike that they don't invest more attention into Linux but that's just company priority for you.

I fixed all of my Wayland- and hardware acceleration issues by switching my GPU to AMD

Comments like these are just unhelpful for everybody involved, it's off-topic (this comment too). Everybody here knows driver support is better on AMD (or should at least), some people can't buy another GPU (like being too poor for another GPU) or it doesn't make sense for them to switch (like people who have AI workloads).

Ideally using Wayland should be device agnostic.

But Cylon already told you this and you didn't address their strong arguments so I'll default to you not being here for a good faith discussion. Please just don't comment this, it clogs up the issue which might make a dev less interested working on this.

ar-nadeem commented 11 months ago

Hey, good news. I think it is fixed. Screenshot_20230730_135519

Driver: 535.86.05 GPU: RTX 3070 01:00.0 VGA compatible controller: NVIDIA Corporation GA104 [GeForce RTX 3070] (rev a1) Subsystem: Palit Microsystems Inc. GA104 [GeForce RTX 3070] Kernel driver in use: nvidia Kernel modules: nouveau, nvidia_drm, nvidia

glaeqen commented 11 months ago

With wlroots bad luck still:

/usr/lib/xdg-desktop-portal-wlr -l TRACE -r && trying to start the screen sharing both in Chromium and Firefox.

2023/07/30 14:58:53 [INFO] - dbus: start method invoked
2023/07/30 14:58:53 [INFO] - dbus: request_handle: /org/freedesktop/portal/desktop/request/1_24/webrtc2043827389
2023/07/30 14:58:53 [INFO] - dbus: session_handle: /org/freedesktop/portal/desktop/session/1_24/webrtc_session1289938188
2023/07/30 14:58:53 [INFO] - dbus: app_id:
2023/07/30 14:58:53 [INFO] - dbus: parent_window:
2023/07/30 14:58:53 [DEBUG] - dbus: start: found matching session /org/freedesktop/portal/desktop/session/1_24/webrtc_session1289938188
2023/07/30 14:58:53 [TRACE] - wlroots: callbacks registered
2023/07/30 14:58:53 [TRACE] - wlroots: buffer event handler
2023/07/30 14:58:53 [ERROR] - xdg-desktop-portal-wlr: unsupported wl_shm format 0x34324742
fish: Job 1, '/usr/lib/xdg-desktop-portal-wlr…' terminated by signal SIGABRT (Abort)
ar-nadeem commented 11 months ago

I am using xdg-desktop-portal-kde Let me know if you would like any more information on logs.

potatogod3000 commented 11 months ago

WebRTC is working fine in Firefox (both Window and Screen Sharing). I get the black screen with just a cursor in both screen and window capture in Telegram Wayland screen sharing though. I have attached the image below. (@ar-nadeem)

My Specs: Fedora 38 (Up-to-date) KDE Plasma 5.27.6 (with both xdg-desktop-portal-kde and xdg-desktop-portal-gtk installed) NVIDIA Proprietary Driver version 535.86.05 All non-free codecs from RPMFusion

WebRTC in Firefox: Screenshot_00-40_31-07-2023

Telegram Desktop (rpm package) screensharing not working: image

ar-nadeem commented 11 months ago

I yet have to test with other applications. But this also now works on gnome. You have to install pipewire-media-session and all other pipewire related stuff. Then reboot and it will work.

glaeqen commented 11 months ago

Small nitpick

You have to install pipewire-media-session and all other pipewire related stuff. Then reboot and it will work.

pipewire-media-session is not supposed to be used, it was just a demo session manager for which wireplumber is a fully featured replacement. FYI

erik-kz commented 8 months ago

For sway, naively adding support for DRM_FORMAT_BGR888 to xdg-desktop-portal-wlr appears to work

diff --git a/src/screencast/screencast_common.c b/src/screencast/screencast_common.c
index d6d13db..69bd83c 100644
--- a/src/screencast/screencast_common.c
+++ b/src/screencast/screencast_common.c
@@ -264,6 +264,7 @@ enum wl_shm_format xdpw_format_wl_shm_from_drm_fourcc(uint32_t format) {
                return WL_SHM_FORMAT_ARGB8888;
        case DRM_FORMAT_XRGB8888:
                return WL_SHM_FORMAT_XRGB8888;
+       case DRM_FORMAT_BGR888:
        case DRM_FORMAT_RGBA8888:
        case DRM_FORMAT_RGBX8888:
        case DRM_FORMAT_ABGR8888:
@@ -293,6 +294,7 @@ uint32_t xdpw_format_drm_fourcc_from_wl_shm(enum wl_shm_format format) {
                return DRM_FORMAT_ARGB8888;
        case WL_SHM_FORMAT_XRGB8888:
                return DRM_FORMAT_XRGB8888;
+       case WL_SHM_FORMAT_BGR888:
        case WL_SHM_FORMAT_RGBA8888:
        case WL_SHM_FORMAT_RGBX8888:
        case WL_SHM_FORMAT_ABGR8888:
@@ -318,6 +320,8 @@ uint32_t xdpw_format_drm_fourcc_from_wl_shm(enum wl_shm_format format) {

 enum spa_video_format xdpw_format_pw_from_drm_fourcc(uint32_t format) {
        switch (format) {
+       case DRM_FORMAT_BGR888:
+               return SPA_VIDEO_FORMAT_BGR;
        case DRM_FORMAT_ARGB8888:
                return SPA_VIDEO_FORMAT_BGRA;
        case DRM_FORMAT_XRGB8888:
erik-kz commented 8 months ago

Ha, it looks like someone made such a change just yesterday https://github.com/emersion/xdg-desktop-portal-wlr/commit/84a9cf40fb6e5b2900c7d245a1ac8acad828a88f

So screencast with sway/wlroots ought to be working with the latest xdg-desktop-portal-wlr