SOLVED: How to deal with "Failed to launch GPU process"?

Having problems with building or using the JCEF Java binding? Ask your questions here.

Re: How to deal with "Failed to launch GPU process"?

Postby joachimdurchholzsix » Thu Jun 11, 2020 9:55 am

Heh.
Competition is JxBrowser, and the showstopper is their track record of multithreading fixes, still-open multithreading bugs, and that they did not mention a real plan how to get that under control.
Not that they are totally incompetent, otherwise JxBrowser wouldn't be working at all!
But it seems they hit some limit there.

Now we could live with that if your application were rock-solid about multithreading, but it isn't, and we can't afford to have multiple sources of multithreading issues.
(Our application went through the hands of people with more enthusiasm than competence I believe, and that was the time when it was found that doing HTTP requests in the normal Event Dispatch Thread is a Bad Idea(tm). Most of the fallout has been cleaned up, but we can't be confident that we found everything.)

Now the JxBrowser API is expressly marked as "not threadsafe", so we'd have to write our own wrapper around the whole JxBrowser API that forces all calls into a single thread.
And forcing our code into this structure (but alternating between SwingWorkerThread and JxBrowserThread):
Image,
or maybe use RxJava to avoid that effect.
joachimdurchholzsix
Techie
 
Posts: 29
Joined: Mon Jun 08, 2020 3:52 am

Re: How to deal with "Failed to launch GPU process"?

Postby joachimdurchholzsix » Thu Jun 11, 2020 9:59 am

Back to our regular scheduled problem investigation:

What about the .pak/.dat/.bin files? Are they found via the path, or relative to the loaded dll?

Do the .dlls and the .exe have to be in PATH, or is java.library.path okay?
Do I need to have the swiftshader directory in the path explicitly?
joachimdurchholzsix
Techie
 
Posts: 29
Joined: Mon Jun 08, 2020 3:52 am

Re: How to deal with "Failed to launch GPU process"?

Postby magreenblatt » Thu Jun 11, 2020 11:32 am

joachimdurchholzsix wrote:What about the .pak/.dat/.bin files? Are they found via the path, or relative to the loaded dll?

They should be found by Chromium/CEF relative to the location of libcef.dll. Separate locations can also be configured as documented in the CEF README.txt file ("src/third_party/cef/cef_binary_*/README.txt" in your local JCEF build).

joachimdurchholzsix wrote:Do the .dlls and the .exe have to be in PATH, or is java.library.path okay?

They should all be in the same directory with libcef.dll (except swiftshader), and that directory should be in the path (PATH or java.library.path, whatever works with your JVM version).

joachimdurchholzsix wrote:Do I need to have the swiftshader directory in the path explicitly?

That shouldn't be necessary. They just have to exist at the correct location relative to libcef.dll.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: How to deal with "Failed to launch GPU process"?

Postby joachimdurchholzsix » Thu Jun 11, 2020 11:52 am

Okay... then everything is in place, yet it's still not working.

I managed the get rid of the GPU process crashing via

Code: Select all
CefApp.getInstance(
            new String[]{"--disable-gpu", "--disable-software-rasterizer", "--disable-gpu-compositing"},
            settings)


but then I just get a white window when running from IntelliJ, and a black window when running from the command line.
joachimdurchholzsix
Techie
 
Posts: 29
Joined: Mon Jun 08, 2020 3:52 am

Re: How to deal with "Failed to launch GPU process"?

Postby magreenblatt » Thu Jun 11, 2020 12:14 pm

You mention above that it works with the detailed sample app. In what ways does your app differ from the detailed sample app?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: How to deal with "Failed to launch GPU process"?

Postby joachimdurchholzsix » Thu Jun 11, 2020 12:48 pm

Lots of EDT activities were refactored into WorkerThreads, including some that should have stayed in the EDT (we're cleaning that up but you always miss something).
JFrames are all Type.UTILITY with window decorations switched off (including the JFrame that contains the browser JComponent).

Possibly more. It's a pretty big application - 360 kLoC of Java, driven by another 360 kLoC of XML, application .jar 8.6 MB, dependency .jars 55.0 MB...
Making an sscce is usually at least a challenge, and mostly an unattainable ideal. (Unfortunately.)
joachimdurchholzsix
Techie
 
Posts: 29
Joined: Mon Jun 08, 2020 3:52 am

Re: How to deal with "Failed to launch GPU process"?

Postby magreenblatt » Thu Jun 11, 2020 3:02 pm

I suggest taking the integration in baby steps.

  • Verify that you're implementing each of the setup steps shown in the example MainFrame.java in your application.
  • Try launching a stand-alone browser window that is not embedded in your window hierarchy to verify that the setup is correct.
  • Then try integrating the browser into your application's window hierarchy.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: How to deal with "Failed to launch GPU process"?

Postby joachimdurchholzsix » Thu Jun 11, 2020 3:07 pm

Sounds like a plan.
I'll be back with reports.
joachimdurchholzsix
Techie
 
Posts: 29
Joined: Mon Jun 08, 2020 3:52 am

Re: How to deal with "Failed to launch GPU process"?

Postby joachimdurchholzsix » Fri Jun 12, 2020 3:29 am

Got our initialization shortcuts fixed - I suspected that java-cef startup in some background thread or possibly even the EDT might throw it off.
Sadly, no change in behaviour from that.
joachimdurchholzsix
Techie
 
Posts: 29
Joined: Mon Jun 08, 2020 3:52 am

Re: How to deal with "Failed to launch GPU process"?

Postby joachimdurchholzsix » Tue Jun 16, 2020 12:52 am

Some news - company decided to go forward with java-cef. Multithreading was the decisive factor. Congrats :-)
We'll find more time to work on integration in July. I'll be back ;-)
joachimdurchholzsix
Techie
 
Posts: 29
Joined: Mon Jun 08, 2020 3:52 am

PreviousNext

Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 21 guests