no hardware acceleration under Linux

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

no hardware acceleration under Linux

Postby ozster123 » Tue Sep 03, 2019 3:53 am

Hi,

I have built CEF v76 release branch 3809 for Linux. I run cefclient using the following cmd line
Code: Select all
./cefclient --autoplay-policy=no-user-gesture-required --ppapi-flash-path=/usr/lib64/chromium/PepperFlash/libpepflashplayer.so --ppapi-flash-version=32.0.0.238 --ignore-gpu-blacklist


The log output is
Code: Select all
[0903/092705.260719:ERROR:gl_surface_glx.cc(78)] XGetWindowAttributes failed for window 12582916.
[0903/092705.261052:ERROR:gl_surface_glx.cc(817)] Failed to get GLXConfig
[0903/092705.261117:ERROR:gpu_info_collector.cc(50)] gl::GLContext::CreateOffscreenGLSurface failed
[0903/092705.261174:ERROR:gpu_info_collector.cc(179)] Could not create surface for info collection.
[0903/092705.261231:ERROR:gpu_init.cc(64)] gpu::CollectGraphicsInfo failed.
[0903/092705.267372:WARNING:x11_util.cc(1430)] X error received: serial 173, error_code 8 (BadMatch (invalid parameter attributes)), request_code 78, minor_code 0 (X_CreateColormap)
[0903/092705.267629:WARNING:x11_util.cc(1430)] X error received: serial 183, error_code 12 (BadColor (invalid Colormap parameter)), request_code 1, minor_code 0 (X_CreateWindow)
[0903/092705.267706:WARNING:x11_util.cc(1430)] X error received: serial 184, error_code 3 (BadWindow (invalid Window parameter)), request_code 3, minor_code 0 (X_GetWindowAttributes)
[0903/092705.268170:ERROR:viz_main_impl.cc(170)] Exiting GPU process due to errors during initialization
[0903/092705.269353:WARNING:x11_util.cc(1430)] X error received: serial 186, error_code 3 (BadWindow (invalid Window parameter)), request_code 4, minor_code 0 (X_DestroyWindow)
[0903/092705.308230:WARNING:gpu_process_host.cc(1186)] The GPU process has crashed 1 time(s)
[0903/092705.432553:WARNING:gpu_process_host.cc(962)] Reinitialized the GPU process after a crash. The reported initialization time was 49 ms
[0903/093141.047578:ERROR:cefclient_gtk.cc(50)] Received termination signal: 15
[0903/093141.061427:WARNING:gpu_process_host.cc(1186)] The GPU process has crashed 2 time(s)
[0903/093141.193275:WARNING:gpu_process_host.cc(962)] Reinitialized the GPU process after a crash. The reported initialization time was 54 ms


When I check chrome://gpu it shows that we are using software rendering.

Using CEF v72 release branch 3626 on the same system will use hardware acceleration.

I know there is a big time gap between v72 and v76. Is there anything I need to enable or build into Linux so that v76 is hardware accelerated again?
ozster123
Newbie
 
Posts: 5
Joined: Thu Sep 07, 2017 7:41 am

Re: no hardware acceleration under Linux

Postby Czarek » Tue Sep 03, 2019 7:10 am

You've added "--ignore-gpu-blacklist" flag and then in logs you can see that GPU process crashed. If your GPU is blacklisted then it is expected that GPU will most probably crash. Does hardware acceleration work in Chrome at the same version?
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: no hardware acceleration under Linux

Postby ozster123 » Tue Sep 03, 2019 8:14 am

I don't think that is the issue as I get the same set of messages with or without the "--ignore-gpu-blacklist" flag.
I have downloaded standard linux distro for version 73 which works and is accelerated. Then downloaded version 74 which is the first version that breaks for me.
I think the first failure is interesting
Code: Select all
[0903/133647.363364:ERROR:gl_surface_glx.cc(77)] XGetWindowAttributes failed for window 8388612.


Which I think corresponds to this code
Code: Select all
GLXFBConfig GetConfigForWindow(Display* display,
                               gfx::AcceleratedWidget window) {
  DCHECK(window != 0);
  // This code path is expensive, but we only take it when
  // attempting to use GLX_ARB_create_context_robustness, in which
  // case we need a GLXFBConfig for the window in order to create a
  // context for it.
  //
  // TODO(kbr): this is not a reliable code path. On platforms which
  // support it, we should use glXChooseFBConfig in the browser
  // process to choose the FBConfig and from there the X Visual to
  // use when creating the window in the first place. Then we can
  // pass that FBConfig down rather than attempting to reconstitute
  // it.
  XWindowAttributes attributes;
  if (!XGetWindowAttributes(display, window, &attributes)) {
    LOG(ERROR) << "XGetWindowAttributes failed for window " << window << ".";
    return nullptr;
  }


It could be that the failure here breaks the detection code or perhaps we should not be here in the first place reading the comment in the code itself.
ozster123
Newbie
 
Posts: 5
Joined: Thu Sep 07, 2017 7:41 am

Re: no hardware acceleration under Linux

Postby magreenblatt » Tue Sep 03, 2019 9:24 am

How does it behave in Google Chrome at v76?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: no hardware acceleration under Linux

Postby ozster123 » Wed Sep 04, 2019 2:26 am

I installed the binary package for Google Chrome v76 and built the source package for Chromium v76. They both have the same issue and report the same failures. Starting to think it is an issue with our linux build.
ozster123
Newbie
 
Posts: 5
Joined: Thu Sep 07, 2017 7:41 am

Re: no hardware acceleration under Linux

Postby ozster123 » Wed Sep 04, 2019 9:07 am

I spent some time matching the log messages to the code. These X errors.
Code: Select all
[0904/145512.457316:WARNING:x11_util.cc(1430)] X error received: serial 173, error_code 8 (BadMatch (invalid parameter attributes)), request_code 78, minor_code 0 (X_CreateColormap)
[0904/145512.457614:WARNING:x11_util.cc(1430)] X error received: serial 183, error_code 12 (BadColor (invalid Colormap parameter)), request_code 1, minor_code 0 (X_CreateWindow)
[0904/145512.457701:WARNING:x11_util.cc(1430)] X error received: serial 184, error_code 3 (BadWindow (invalid Window parameter)), request_code 3, minor_code 0 (X_GetWindowAttributes)
[0904/145512.457856:WARNING:x11_util.cc(1430)] X error received: serial 186, error_code 3 (BadWindow (invalid Window parameter)), request_code 4, minor_code 0 (X_DestroyWindow)

Match this code.
Code: Select all
bool UnmappedNativeViewGLSurfaceGLX::Initialize(GLSurfaceFormat format) {
  DCHECK(!window_);

  gfx::AcceleratedWidget parent_window = DefaultRootWindow(gfx::GetXDisplay());

  XSetWindowAttributes attrs;
  attrs.border_pixel = 0;
  attrs.colormap = g_colormap;
  window_ = XCreateWindow(
      gfx::GetXDisplay(), parent_window, 0, 0, size_.width(), size_.height(), 0,
      g_depth, InputOutput, g_visual, CWBorderPixel | CWColormap, &attrs);
  if (!window_) {
    LOG(ERROR) << "XCreateWindow failed";
    return false;
  }
  GetConfig();
  if (!config_) {
    LOG(ERROR) << "Failed to get GLXConfig";
    return false;
  }
  glx_window_ = glXCreateWindow(gfx::GetXDisplay(), config_, window_, NULL);
  if (!glx_window_) {
    LOG(ERROR) << "glXCreateWindow failed";
    return false;
  }
  return true;
}

The first failure XCreateColorMap means that the window creation fails and then the detection code fails. However I have no idea why the call to XCreateColorMap fails. Is this a issue with our Xorg configuration? Does cef request a specific color map? Any ideas?
ozster123
Newbie
 
Posts: 5
Joined: Thu Sep 07, 2017 7:41 am

Re: no hardware acceleration under Linux

Postby magreenblatt » Wed Sep 04, 2019 9:37 am

Since the problem reproduces with Google Chrome you can file a bug report at https://crbug.com.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: no hardware acceleration under Linux

Postby magreenblatt » Tue Sep 24, 2019 9:30 am

It might be related to this Chromium issue.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 95 guests