[nvidia][wayland] OpenGL applications that use textures don't work (hang) or report errors

Bug #2070084 reported by Gonzalo Garramuno
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu
Invalid
Undecided
Unassigned

Bug Description

I apologize if this is in the wrong category. I reported this bug to NVidia, but thought I should report it with you guys too, as the Wayland version in Ubuntu 24.04.4 LTS has changed.

$ lsb_release -rd
No LSB modules are available.
Description: Ubuntu 24.04 LTS
Release: 24.04

I have been testing Wayland on Ubuntu 22.04.4 LTS successfully with NVidia drivers and this setup:

libnvidia-cfg1-535:amd64 install
libnvidia-common-535 install
libnvidia-compute-535:amd64 install
libnvidia-compute-535:i386 install
libnvidia-decode-535:amd64 install
libnvidia-decode-535:i386 install
libnvidia-encode-535:amd64 install
libnvidia-encode-535:i386 install
libnvidia-extra-535:amd64 install
libnvidia-fbc1-535:amd64 install
libnvidia-fbc1-535:i386 install
libnvidia-gl-535:amd64 install
libnvidia-gl-535:i386 install

together with:

libnvidia-egl-wayland1:amd64 taken from the Ubuntu 24.04.4 LTS repository.

Except for some minor issues with Google Chrome's title bar, it worked very well. My OpenGL application would work fine.

Now, with Ubuntu 24.04.4 LTS, and the latest NVidia drivers:

libnvidia-cfg1-555:amd64 install
libnvidia-common-555 install
libnvidia-compute-555:amd64 install
libnvidia-decode-555:amd64 install
libnvidia-egl-wayland1:amd64 install
libnvidia-encode-555:amd64 install
libnvidia-extra-555:amd64 install
libnvidia-fbc1-555:amd64 install
libnvidia-gl-555:amd64 install

OpenGL applications that use textures don't work (hang) or report errors. Also, Google Chrome's window did not show up when reporting the bug (I had to log in as X11).

To test it quickly, you can use my open source OpenGL video player (compiled on Rocky Linux 8.10 for compatibility so you'll get some warnings), which can be downloaded from:

https://github.com/ggarra13/mrv2/releases

If you are afraid of binary releases, here are two tests (a quick FLTK only test):

sudo apt install make \
libpango1.0-dev \
libwayland-dev \
wayland-protocols \
libxkbcommon-dev \
libxinerama-dev \
libdbus-1-dev \
libglew-dev \
cmake \
libgtk-3-dev

git clone https://github.com/fltk/fltk
mkdir build
cd build
cmake .. -D FLTK_BUILD_EXAMPLES=ON
make
cd bin/test
export FLTK_BACKEND=x11
./cube # works fine
export FLTK_BACKEND=wayland
./cube # hangs
cd -
cd bin/examples
./OpenGL3test # to verify driver version and OpenGL setup

and my own viewer (a longer test, in the quickest compile option -- takes about 8 mins to compile):

I can have you compile my program with minimal functionality so that you can test it too. Tested on Ubuntu 24.04.4 LTS under amd64.

$ git clone https://github.com/ggarra13/mrv2

Install dependencies:

$ sudo apt update
$ sudo apt -y install curl build-essential perl git cmake ninja-build \
                    libpango1.0-dev \
            xorg-dev libx11-dev libxcursor-dev libxinerama-dev \
            libxss-dev gettext libasound2-dev \
            libpulse-dev libssl-dev libffi-dev \
            libwayland-dev wayland-protocols libdbus-1-dev \
            libxkbcommon-dev libegl-dev libgtk-3-dev rpm \
                    doxygen tk-dev libxt-dev libnvidia-egl-wayland1

$ mkdir -p $HOME/bin

$ export PATH=$HOME/bin:$PATH

$ cd mrv2

$ bin/runme_ffmpeg_exr.sh # All runme* scripts can run in "debug" mode by appending debug to them.

(say y to the prompt)

Once it is done, it should create a symlink from BUILD-Linux-amd64/Release/install/bin/mrv2.sh to $HOME/bin/mrv2

Test it with:

$ mrv2 /path/to/a/movie.mp4

You will get all sort of texture warnings and no playback under Ubuntu 24.04.4 LTS but should work fine under Ubuntu 22.04.4 LTS.

What I expect to happen. OpenGL applications should not hang nor should they report errors under Wayland.

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: wayland-protocols 1.34-1
ProcVersionSignature: Ubuntu 6.8.0-35.35-generic 6.8.4
Uname: Linux 6.8.0-35-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.28.1-0ubuntu3
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Fri Jun 21 21:29:20 2024
Dependencies:

InstallationDate: Installed on 2024-06-12 (9 days ago)
InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Release amd64 (20240424)
PackageArchitecture: all
ProcEnviron:
 LANG=es_ES.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
SourcePackage: wayland-protocols
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Gonzalo Garramuno (ggarra13) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for the bug report. Please:

1. Try a version of the Nvidia driver that is officially shipped with Ubuntu 24.04, such as 535.

2. Try running the affected apps in a terminal and then tell us what errors you receive.

3. Check for crashes by following: https://wiki.ubuntu.com/Bugs/Responses#Missing_a_crash_report_or_having_a_.crash_attachment

summary: - Ubuntu 24.04.4 LTS Wayland regression from Ubuntu 22.04.4 LTS
+ OpenGL applications that use textures don't work (hang) or report errors
summary: - OpenGL applications that use textures don't work (hang) or report errors
+ [nvidia][wayland] OpenGL applications that use textures don't work
+ (hang) or report errors
affects: wayland-protocols (Ubuntu) → ubuntu
Changed in ubuntu:
status: New → Incomplete
tags: added: nvidia nvidia-wayland
Revision history for this message
Gonzalo Garramuno (ggarra13) wrote (last edit ):

1. Tried it with the official 535 NVidia driver from the Ubuntu repositories and added libnvidia-egl-wayland1 for HW acceleration.
   Results are the same.
   Works fine on X11.
   Does not work on Wayland.

2 the FLTK cube demo hangs on Wayland.
   My application, which is more verbose, reports on Wayland:
        ERROR: [view] Cannot create color texture
        ERROR: [timeline] Cannot create color texture
        eglMakeCurrent() failed

3. There are no crashes to report. Only hanging in the case of the FLTK cube application and tons of errors about the texture not being created on my video application.

Revision history for this message
Gonzalo Garramuno (ggarra13) wrote :

Here are the journal.txt as requested:

Revision history for this message
Gonzalo Garramuno (ggarra13) wrote :

And the prevjournal.txt:

Revision history for this message
Gonzalo Garramuno (ggarra13) wrote :

And the prevjournal.txt:

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That suggests to me the Nvidia driver is not installing cleanly (kind of like bug 2063827 maybe).

Did you use the 'Additional Drivers' app to install the driver?

Can you get any more error details from affected applications?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The log in comment #4 also contains bug 1967707. You can use the workarounds in bug 2060268 to avoid that. I have suspected the same issues might be causing bug 2063827 too.

Revision history for this message
Gonzalo Garramuno (ggarra13) wrote :
Download full text (5.9 KiB)

This is a fresh install taken from the official download of Ubuntu 24.04.4 LTS, not an upgrade from 22.04.4 LTS which broke everything.

First, I removed the unofficial ppa graphics repository with Software and Update graphically.
Then I did:

$ sudo bash
# apt --purge remove nvidia-driver-555
# apt install nvidia-driver-535
# apt install libnvidia-egl-wayland1
# reboot

I think you are right, the NVidia drivers are now no longer installed properly (the 555 drivers I was using were installed fine).

$ eglgears_wayland shows up, but stutters with the 535 drivers.
$ eglinfo reports it is using Mesa.

However, if I check:

$ nvidia-smi
Mon Jun 24 04:20:02 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.171.04 Driver Version: 535.171.04 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 3080 Off | 00000000:09:00.0 On | N/A |
| 0% 42C P8 29W / 370W | 409MiB / 10240MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 4917 G /usr/bin/gnome-shell 194MiB |
| 0 N/A N/A 5143 G /usr/bin/Xwayland 97MiB |
| 0 N/A N/A 5817 G /usr/libexec/xdg-desktop-portal-gnome 5MiB |
| 0 N/A N/A 7942 G ...seed-version=20240623-180253.409000 89MiB |
+---------------------------------------------------------------------------------------+

The common aspect of the FLTK cube application and my viewer, is that they have two embedded OpenGL windows within the main Window.

The FLTK cube application works fine under X11 or XWayland.
Under Wayland, the application does not show up the main window (only the cogwheel icon shows on the dockbar). And, as such, it hangs on the main loop (waiting for the window to show).

Another FLTK application that opens just a single OpenGL window also works fine under Wayland.

My application, on the other hand, shows up the window pr...

Read more...

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yes that's bug 2060268. Please apply one of the workarounds mentioned on that page.

Revision history for this message
Gonzalo Garramuno (ggarra13) wrote :

Thanks. Applying the grub work-around got rid of the two monitor configurations.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I was hoping that by not making GNOME think it has a second GPU and second monitor which doesn't exist, it would solve unusual Nvidia-Wayland bugs like this one.

Revision history for this message
Gonzalo Garramuno (ggarra13) wrote :

No, it did not. Also, applying the grub work-around removed the splash screen of Ubuntu upon booting.

I really cannot understand it. Ubuntu 22.04.4 LTS was working beautifully with an older Wayland and NVidia drivers (535). But Ubuntu 24.04.4 LTS's Wayland is all broken.

On Ubuntu 22.04.4 LTS, I could switch from NVidia drivers to Mesa by just uninstalling libnvidia-egl-wayland1 for te

Revision history for this message
Gonzalo Garramuno (ggarra13) wrote :

I feel ashamed. I found out the cause for **my** program for misbehaving on Wayland. It had to do with a new version of glfw3 that broke Wayland support.

I still don't know with the FLTK demo application hangs, thou.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

No problem. The remaining issue might be https://github.com/fltk/fltk/issues/973 but otherwise it should be discussed at https://github.com/fltk/fltk/issues

Changed in ubuntu:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.