Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. X11 Nvidia black window
Qt 6.12 LTS is out! See what's new in the release blog

X11 Nvidia black window

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 5 Posters 853 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    emfo
    wrote on last edited by
    #1

    We get a black window when running smallest possible Qt application using OpenGL on Linux with an Nvidia graphics card (proprietary 580.159.03).

    To rule out environment and driver problems, we have written three corresponding applications using xlib only, xcb only, and a xlib xcb mix. All three of them work on the same Nvidia graphics card in the same environment.
    The attached xlib.cpp, xcb.cpp, xcb_xlib.cpp and qt.cpp can be built following the instructions in build_and_run.sh (replace the QT path in the script to where your Qt installation is first).
    Replacing EGL_PLATFORM_XCB_KHR with EGL_PLATFORM_X11_KHR in xcb_xlib.cpp, and using xlib display, causes eglCreatePlatformWindowSurfaceEXT to return a nullptr for EGLSurface in xcb_xlib.cpp, exactly what we see in Qt.
    Is there something we're missing in qt.cpp to make this work or is this a bug in Qt that can be fixed?
    We started looking into the Qt source code, the call to eglCreatePlatformWindowSurfaceEXT(EGL_PLATFORM_X11_KHR, xlib display, [...]) returns 0. If we modify Qt to call eglCreatePlatformWindowSurfaceEXT(EGL_PLATFORM_XCB_KHR, xcb connection, [...]), we instead get a valid surface that can be queried with eglQuerySurface that report the correct size. The window is still black but having a surface is a good start for anyone looking into this.

    Attached source files

    1 Reply Last reply
    0
    • Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote last edited by
      #2

      I am using X11 on Nvidia and I don't have this issue.
      Please post a minimal reproducer here.

      Software Engineer
      The Qt Company, Oslo

      E 1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote last edited by
        #3

        Hi and welcome to devnet,

        You should also provide the kernel version you are using as well graphics card model.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        E 1 Reply Last reply
        1
        • Axel SpoerlA Axel Spoerl

          I am using X11 on Nvidia and I don't have this issue.
          Please post a minimal reproducer here.

          E Offline
          E Offline
          emfo
          wrote last edited by
          #4

          @Axel-Spoerl the attached sources are a minimal reproducible example.

          1 Reply Last reply
          0
          • SGaistS SGaist

            Hi and welcome to devnet,

            You should also provide the kernel version you are using as well graphics card model.

            E Offline
            E Offline
            emfo
            wrote last edited by
            #5

            @SGaist Thank you. I will find that information and post it here asap.

            1 Reply Last reply
            0
            • E Offline
              E Offline
              emfo
              wrote last edited by emfo
              #6

              We've reproduced the issue on the following combinations:

              • Ubuntu 26.04, Linux 7.0.0, Quadro P2200, driver version 580.178
              • Ubuntu 26.04.1 LTS, Linux 7.0.0-38-generic, GeForce RTX 4060, driver version 595.99.02

              In addition, we've seen the problem manifest on several other combinations of Ubuntu/Linux/graphics card/driver versions, with the only common factor being Qt.

              1 Reply Last reply
              0
              • TimTom420T Offline
                TimTom420T Offline
                TimTom420
                Banned
                wrote last edited by
                #7
                This post is deleted!
                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kavinreed
                  Banned
                  wrote last edited by
                  #8

                  Since the XCB version creates a valid surface while the X11 version returns a null surface, it does sound like the issue could be related to the EGL platform configuration. It would be interesting to see whether the same behavior occurs with a different Nvidia driver version or a minimal Qt example.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt
                  • Unsolved