Skip to content
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

For NVIDIA, glmark2 should use gbm_surface_create_with_modifiers #210

Open
DanaGoyette opened this issue Aug 11, 2023 · 1 comment
Open

Comments

@DanaGoyette
Copy link

With an RTX2060 Super (on an ARM64 board at the moment), glmark2 doesn't manage to run on the NVIDIA open kernel driver.

Debug: Using Udev to detect the right DRM node to use
Debug: Looking for the main GPU DRM node...
Debug: Success!
Debug: Trying to use the DRM node /dev/dri/card0
Debug: Success!
Error: Failed to create GBM surface
Debug: Using eglGetPlatformDisplayEXT()
Debug: Got 10 suitable EGLConfigs:
Debug:
Debug:     cfg buf  rgb  colorbuffer dp st config native support surface sample
Debug:      id  sz  lum  r  g  b  a  th cl caveat render  visid    type  buf ns
Debug: ------------------------------------------------------------------------
Debug:     0x2  32  rgb  8  8  8  8  24  0   None  false0x34325241   0x805   0  0
Debug:     0x1  32  rgb  8  8  8  8  24  8   None  false0x34325241   0x805   0  0
Debug:     0x6  32  rgb  8  8  8  8  24  0   None  false0x34325241   0x805   1  2
Debug:     0x5  32  rgb  8  8  8  8  24  8   None  false0x34325241   0x805   1  2
Debug:     0xb  32  rgb  8  8  8  8  24  0   None  false0x34325241   0x805   1  4
Debug:     0xc  32  rgb  8  8  8  8  24  0   None  false0x34325241   0x805   1  4
Debug:     0x9  32  rgb  8  8  8  8  24  8   None  false0x34325241   0x805   1  4
Debug:     0xa  32  rgb  8  8  8  8  24  8   None  false0x34325241   0x805   1  4
Debug:    0x12  32  rgb  8  8  8  8  24  0   None  false0x34325241   0x805   1  8
Debug:    0x11  32  rgb  8  8  8  8  24  8   None  false0x34325241   0x805   1  8
Debug:
Debug: Best EGLConfig ID: 0x2

When I searched the web for gbm_surface_create nvidia, I found a patch that MPV has to use DRM rendering on NVIDIA; I believe glmark2 should do the same thing:

mpv-player/mpv#9384

When I tried hacking up just the gbm_surface_create to use the "modifier" value (0x300000000606014) that mpv says it's using, it just crashes the GPU driver. It seems it also needs a change to use AddFB2WithModifiers, and I decided at that point to just file this bug report.

@DanaGoyette
Copy link
Author

I moved the GPU to a Thunderbolt enclosure to work around some PSU issues, but glmark2-es2-drm still crashes.

Debug: Using Udev to detect the right DRM node to use
Debug: Looking for the main GPU DRM node...
Debug: Success!
Debug: Trying to use the DRM node /dev/dri/card0
Debug: Success!
Error: Failed to create GBM surface
Debug: Using eglGetPlatformDisplayEXT()
Debug: Got 10 suitable EGLConfigs:
Debug:
Debug:     cfg buf  rgb  colorbuffer dp st config native support surface sample
Debug:      id  sz  lum  r  g  b  a  th cl caveat render  visid    type  buf ns
Debug: ------------------------------------------------------------------------
Debug:     0x2  32  rgb  8  8  8  8  24  0   None  false0x34325241   0x805   0  0
Debug:     0x1  32  rgb  8  8  8  8  24  8   None  false0x34325241   0x805   0  0
Debug:     0x6  32  rgb  8  8  8  8  24  0   None  false0x34325241   0x805   1  2
Debug:     0x5  32  rgb  8  8  8  8  24  8   None  false0x34325241   0x805   1  2
Debug:     0xb  32  rgb  8  8  8  8  24  0   None  false0x34325241   0x805   1  4
Debug:     0xc  32  rgb  8  8  8  8  24  0   None  false0x34325241   0x805   1  4
Debug:     0x9  32  rgb  8  8  8  8  24  8   None  false0x34325241   0x805   1  4
Debug:     0xa  32  rgb  8  8  8  8  24  8   None  false0x34325241   0x805   1  4
Debug:    0x12  32  rgb  8  8  8  8  24  0   None  false0x34325241   0x805   1  8
Debug:    0x11  32  rgb  8  8  8  8  24  8   None  false0x34325241   0x805   1  8
Debug:
Debug: Best EGLConfig ID: 0x2

Program received signal SIGSEGV, Segmentation fault.

A gdb backtrace:

0x0000fffff7312ecc in ?? () from /lib/aarch64-linux-gnu/libnvidia-egl-gbm.so.1
(gdb) bt full
#0  0x0000fffff7312ecc in ?? () from /lib/aarch64-linux-gnu/libnvidia-egl-gbm.so.1
No symbol table info available.
#1  0x0000fffff74e4e90 in ?? () from /lib/aarch64-linux-gnu/libEGL_nvidia.so.0
No symbol table info available.
#2  0x0000fffff74e4f38 in ?? () from /lib/aarch64-linux-gnu/libEGL_nvidia.so.0
No symbol table info available.
#3  0x0000fffff7489594 in ?? () from /lib/aarch64-linux-gnu/libEGL_nvidia.so.0
No symbol table info available.
#4  0x0000aaaaaaab0774 in GLStateEGL::gotValidSurface (this=0xfffffffff010) at ../src/gl-state-egl.cpp:687
No locals.
#5  GLStateEGL::gotValidSurface (this=0xfffffffff010) at ../src/gl-state-egl.cpp:676
No locals.
#6  0x0000aaaaaaab0830 in GLStateEGL::init_surface (native_window=<optimized out>, this=<optimized out>) at ../src/gl-state-egl.cpp:336
No locals.
#7  CanvasGeneric::do_make_current (this=this@entry=0xfffffffff118) at ../src/canvas-generic.cpp:285
No locals.
#8  0x0000aaaaaaab0e50 in CanvasGeneric::reset (this=0xfffffffff118) at ../src/canvas-generic.cpp:59
No locals.
#9  CanvasGeneric::reset (this=0xfffffffff118) at ../src/canvas-generic.cpp:49
No locals.
#10 0x0000aaaaaaaaa348 in main (argc=<optimized out>, argv=<optimized out>) at ../src/main.cpp:205
        native_state = {<NativeState> = {_vptr.NativeState = 0xaaaaaab2a0d8 <vtable for NativeStateDRM+16>}, static should_quit_ = 0, fd_ = 3, resources_ = 0xaaaaaab73410, connector_ = 0xaaaaaab73ea0,
          encoder_ = 0xaaaaaab5c400, crtc_ = 0x0, mode_ = 0xaaaaaab6e8e4, dev_ = 0xaaaaaab6f8f0, surface_ = 0x0, bo_ = 0x0, fb_ = 0x0, crtc_set_ = false}
        gl_state = {<GLState> = {_vptr.GLState = 0xaaaaaab2a008 <vtable for GLStateEGL+16>}, native_display_ = 0xaaaaaab6f8f0, native_window_ = 0x0, egl_display_ = 0xaaaaaabbe6a0, egl_config_ = 0xcaf32a, egl_context_ = 0x0,
          egl_surface_ = 0x0, requested_visual_config_ = {red = 1, green = 1, blue = 1, alpha = 1, depth = 1, stencil = 0, buffer = 1}, best_config_ = {handle_ = 0xcaf32a, bufferSize_ = 32, redSize_ = 8, greenSize_ = 8,
            blueSize_ = 8, luminanceSize_ = 0, alphaSize_ = 8, alphaMaskSize_ = 0, bindTexRGB_ = false, bindTexRGBA_ = false, bufferType_ = 12430, caveat_ = 12344, configID_ = 2, conformant_ = 77, depthSize_ = 24, level_ = 0,
            pbufferWidth_ = 32768, pbufferHeight_ = 32768, pbufferPixels_ = 1073741824, minSwapInterval_ = 0, maxSwapInterval_ = 0, nativeID_ = 875713089, nativeType_ = 12344, nativeRenderable_ = false, sampleBuffers_ = 0,
            samples_ = 0, stencilSize_ = 0, surfaceType_ = 2053, xparentType_ = 12344, xparentRedValue_ = 0, xparentGreenValue_ = 0, xparentBlueValue_ = 0}, egl_lib_ = {handle_ = 0xaaaaaab603a0}, gl_lib_ = {
            handle_ = 0xaaaaaabaaba0}}
        canvas = {<Canvas> = {_vptr.Canvas = 0xaaaaaab2a758 <vtable for CanvasGeneric+16>, width_ = 1920, height_ = 1080, projection_ = {m_ = {0.974278629, 0, 0, 0, 0, 1.7320509, 0, 0, 0, 0, -1.00195503, -1, 0, 0, -2.00195503,
                0}}, offscreen_ = false, visual_config_ = {red = 1, green = 1, blue = 1, alpha = 1, depth = 1, stencil = 0, buffer = 1}}, native_state_ = @0xffffffffefb0, gl_state_ = @0xfffffffff010, native_window_ = 0x0,
          gl_color_format_ = 0, gl_depth_format_ = 0, color_renderbuffer_ = 0, depth_renderbuffer_ = 0, fbo_ = 0, window_initialized_ = true}
        scenes = {scenes_ = std::vector of length 18, capacity 32 = {0xaaaaaab416d0, 0xaaaaaab42580, 0xaaaaaab43da0, 0xaaaaaab45cc0, 0xaaaaaab4ba90, 0xaaaaaab4d090, 0xaaaaaab4ebc0, 0xaaaaaab50680, 0xaaaaaab51830,
            0xaaaaaab52a00, 0xaaaaaab53e00, 0xaaaaaab55510, 0xaaaaaab56d80, 0xaaaaaab57d10, 0xaaaaaab58f50, 0xaaaaaab59d00, 0xaaaaaab5ae00, 0xaaaaaab46810}}
        __FUNCTION__ = <optimized out>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant