Coder Social home page Coder Social logo

Comments (12)

traversaro avatar traversaro commented on September 23, 2024 1

After dealing with this issue for the last 4 year, I just saw on Twitter this tweet:
https://twitter.com/r2castellotti/status/1327647698577666053
Through that, I discovered that on Debian-based distributions (such as as Ubuntu) there is a matlab-support package that you can install via apt, and automatically handles the renaming of the libraries vendored by MATLAB to avoid loading conflicts. It probably make sense to document it, and eventually look for a similar solution in macOS . On Windows fortunately nothing should be necessary, thanks to the more sane shared linking model.

from robotology-superbuild.

S-Dafarra avatar S-Dafarra commented on September 23, 2024 1

After dealing with this issue for the last 4 year, I just saw on Twitter this tweet:
https://twitter.com/r2castellotti/status/1327647698577666053
Through that, I discovered that on Debian-based distributions (such as as Ubuntu) there is a matlab-support package that you can install via apt, and automatically handles the renaming of the libraries vendored by MATLAB to avoid loading conflicts. It probably make sense to document it, and eventually look for a similar solution in macOS . On Windows fortunately nothing should be necessary, thanks to the more sane shared linking model.

Indeed, it seems to be solving robotology/wb-toolbox#199 (comment), even if I have graphics issues now

com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :1, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x14b0cf64, isOwner false, <5657b27f, 339bf8fc>[count 0, qsz 0, owner <NULL>]]]
	at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:326)
	at jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:297)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:688)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:580)
	at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:297)
	... 2 more
MATLAB has experienced a low-level graphics error, and may not have drawn correctly.
Read about what you can do to prevent this issue at Resolving Low-Level Graphics Issues then restart MATLAB.
To share details of this issue with MathWorks technical support,
please include this file with your service request.
MATLAB has experienced a low-level graphics error, and may not have drawn correctly.
Read about what you can do to prevent this issue at Resolving Low-Level Graphics Issues then restart MATLAB.
To share details of this issue with MathWorks technical support,
please include this file with your service request.

from robotology-superbuild.

S-Dafarra avatar S-Dafarra commented on September 23, 2024 1

After dealing with this issue for the last 4 year, I just saw on Twitter this tweet:
https://twitter.com/r2castellotti/status/1327647698577666053
Through that, I discovered that on Debian-based distributions (such as as Ubuntu) there is a matlab-support package that you can install via apt, and automatically handles the renaming of the libraries vendored by MATLAB to avoid loading conflicts. It probably make sense to document it, and eventually look for a similar solution in macOS . On Windows fortunately nothing should be necessary, thanks to the more sane shared linking model.

Indeed, it seems to be solving robotology/wb-toolbox#199 (comment), even if I have graphics issues now

com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :1, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x14b0cf64, isOwner false, <5657b27f, 339bf8fc>[count 0, qsz 0, owner <NULL>]]]
	at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:326)
	at jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:297)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:688)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:580)
	at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:297)
	... 2 more
MATLAB has experienced a low-level graphics error, and may not have drawn correctly.
Read about what you can do to prevent this issue at Resolving Low-Level Graphics Issues then restart MATLAB.
To share details of this issue with MathWorks technical support,
please include this file with your service request.
MATLAB has experienced a low-level graphics error, and may not have drawn correctly.
Read about what you can do to prevent this issue at Resolving Low-Level Graphics Issues then restart MATLAB.
To share details of this issue with MathWorks technical support,
please include this file with your service request.

The graphics error got fixed by launching matlab as matlab -softwareopengl. Note that it seems I don't need to edit the LD_LIBRARY_PRELOAD variable anymore.

from robotology-superbuild.

traversaro avatar traversaro commented on September 23, 2024

Relevant comment:

from robotology-superbuild.

traversaro avatar traversaro commented on September 23, 2024

One of the problems is that the actual workaround necessary depends on (at least on Linux, not sure about macOS/:

  1. The libstdc++ version (that is related to the Ubuntu version)
  2. The matlab version

Any possible combination may required different workarounds.

from robotology-superbuild.

traversaro avatar traversaro commented on September 23, 2024

Note that the libstdc++ version of each given Ubuntu version is known (see https://packages.ubuntu.com/search?keywords=libstdc%2B%2B) while the specific libstdc++ vendored in each Matlab version can be automatically obtained by installing and inspecting the relative Matlab Runtime ( https://it.mathworks.com/products/compiler/matlab-runtime.html ).
In theory with this two piece of information it should be possible to document (using a table, for example) for which combination the LD_PRELOAD workaround is necessary, and when it is not.

from robotology-superbuild.

diegoferigo avatar diegoferigo commented on September 23, 2024

I understand that having a table would be ideal, but its maintenance takes time and effort. Since this workaround is no longer required for recent matlab version, what about adding it in a troubleshooting-like section?

from robotology-superbuild.

traversaro avatar traversaro commented on September 23, 2024

Yes, documenting this is totally independent from providing the table, and we should not stop in documenting this even if we do not have the table. I just mentioned the table because I had just discovered Matlab Runtime, and to be honest I was thinking of an automatic script to generate the table (the major problem is that it probably will require ~50 Gb to download all and unpack the version of Matlab Runtime necessary).

Since this workaround is no longer required for recent matlab version

Unfortunately, given the nature of this problem as soon as a new Linux/Ubuntu version will come out (20.04, for example), the workaround may be or may not be necessary depending on the used Matlab version, and the libstdc++ versions used in Ubuntu and in Matlab.

from robotology-superbuild.

diegoferigo avatar diegoferigo commented on September 23, 2024

I just mentioned the table because I had just discovered Matlab Runtime, and to be honest I was thinking of an automatic script to generate the table

🔝

as soon as a new Linux/Ubuntu version will come out (20.04, for example), the workaround may be or may not be necessary depending on the used Matlab version

Last time there was an ABI (?) difference between the two versions if I recall. Let's hope it's not going to happen again next time. Btw this can happen with most of the libraries vendored in Matlab right? So far it happened only with that one for our applications.

from robotology-superbuild.

traversaro avatar traversaro commented on September 23, 2024

This doc page on the topic is nice, we could take inspiration: https://github.com/kyamagu/mexopencv/wiki/Troubleshooting-(UNIX)#macos .

from robotology-superbuild.

traversaro avatar traversaro commented on September 23, 2024

This is the problem we were discussing today. @Andrea8Testa

from robotology-superbuild.

traversaro avatar traversaro commented on September 23, 2024

The graphics error got fixed by launching matlab as matlab -softwareopengl.

Note that this solution may be useful as a workaround to quick launch something, but it is not ideal as it slows down a lot visualization time, especially in complex 3D plots. See #953 for more info.

from robotology-superbuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.