Nw.js: Failed to load libGLESv2.so

Created on 7 Sep 2017  路  11Comments  路  Source: nwjs/nw.js

Hi, I've upgraded NWJS Version from 0.24.4 (works fine) to 0.25 SDK, made a build for linux (ubuntu 16), on macos using https://github.com/evshiron/nwjs-builder-phoenix. win, macos builds - work fine.

while starting app on linux I see blank screen, running app from terminal leads to error output in cycle.

[3594:3594:0907/105316.147021:ERROR:gl_implementation.cc(245)] Failed to load /linux-x64/swiftshader/libGLESv2.so: /linux-x64/swiftshader/libGLESv2.so: cannot open shared object file: No such file or directory
[3594:3594:0907/105316.152250:ERROR:gpu_child_thread.cc(252)] Exiting GPU process due to errors during initialization

Downloaded directly https://dl.nwjs.io/v0.25.0/nwjs-sdk-v0.25.0-linux-x64.tar.gz - starts and is operational, including dev-tools

needinfo

Most helpful comment

Welcome to the club, I did a workaround as well.
Install libgles2-mesa package or something like that - it will install necessary libs. Created directory in project root swiftshader and find at system you install libgles2-mesa all files libEGL.so.* and libEGL.so.* (total 4 or 6 files, do not copy symlinks) and copy to newly created directory - you are done.

All 11 comments

Posted the same at https://github.com/evshiron/nwjs-builder-phoenix/issues/79
I am not sure where from this bug is originating.

I can't reproduce this issue on nwjs-sdk-v0.25.0. On mac, follow the guide in https://github.com/evshiron/nwjs-builder-phoenix and build the nwjs apps for all platforms.
Start the linux-x64 app on Ubuntu 16.04, it works fine, no error. /linux-x64/swiftshader/libGLESv2.sodoesn't exist on my PC.

I did clean install of Ubuntu17, result is the same - error w/ nwjs 0.25.
I rebuild linux build w/ nwjs 0.24.4 using https://github.com/evshiron/nwjs-builder-phoenix - works fine.

I found similar bug reports, most of them are connected to Chromium/Linux combination - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864606, reported on Sun, 11 Jun 2017

Seems bundled chromium w/ nwjs issue.

I can reproduce this with a plain nwjs, by loading a website with 3d canvas on Ubuntu 14.04.

  • start nwjs sdk 0.25.2
  • nw.Window.open("http://www.kevs3d.co.uk/dev/js1kdragons/") from devtools console.

-> page is never loaded, the console gets flooded with the above error message.

(btw, the chromium zip from https://download-chromium.appspot.com/ also ships libGLESv2.so and swiftshader/libGLESv2.so)

Copying src/out/nw/swiftshader/libGLESv2.so and src/out/nw/swiftshader/libEGL.so from the build to swiftshader/ within the nw dir solves that with the above 3d canvas example.

Welcome to the club, I did a workaround as well.
Install libgles2-mesa package or something like that - it will install necessary libs. Created directory in project root swiftshader and find at system you install libgles2-mesa all files libEGL.so.* and libEGL.so.* (total 4 or 6 files, do not copy symlinks) and copy to newly created directory - you are done.

@cryomi As far as I have understood, the swiftshader implementation is a different one than mesa.
So, in my opinion, the libs from the nwjs build should be included.
Windows and OSX work fine for me, but for Linux this patch does the inclusion in the dist target:

diff --git a/tools/package_binaries.py b/tools/package_binaries.py
index 2563967..784c886 100755
--- a/tools/package_binaries.py
+++ b/tools/package_binaries.py
@@ -162,6 +162,8 @@ def generate_target_nw(platform_name, arch, version):
                            'lib/libnw.so',
                            'lib/libnode.so',
                            'lib/libffmpeg.so',
+                           'swiftshader/libEGL.so',
+                           'swiftshader/libGLESv2.so'
                            ]
         if flavor == 'sdk':
             target['input'].append('nwjc')
@@ -452,6 +454,7 @@ def make_packages(targets):
             os.mkdir(folder)
             if platform_name == 'linux':
                 os.mkdir(os.path.join(folder, 'lib'))
+                os.mkdir(os.path.join(folder, 'swiftshader'))
             for f in t['input']:
                 src = os.path.join(binaries_location, f)
                 dest = os.path.join(folder, f)

Yep, you are correct.

@bjoernneumann would you mind to submit a PR? Thanks in advance.

@rogerwang PR #6170

Thanks! This is fixed in git and will be available in the next nightly build.

Was this page helpful?
0 / 5 - 0 ratings