I would like to direct MATLAB to use the Mesa OpenGL libraries or the system OpenGL libraries on a UNIX machine.
MATLAB: How to direct MATLAB to use the Mesa OpenGL libraries or the system OpenGL libraries on a UNIX machine
hardwareMATLABmesaopenglselectsoftwaresolarisunix
Related Solutions
It should be possible to have hardware graphics acceleration turned on for MATLAB, but it requires setting up each client machine. MATLAB uses the library path defined by the Linux operating system to find the graphics libraries. Thus, before MATLAB is started, the library path must be set within Linux to include the directory where the client’s hardware graphics acceleration libraries reside. The following steps should help you enable your local hardware graphics accleration in MATLAB:
1) The hardware graphics acceleration should be installed and enabled on each Linux box. You can verify this by typing
glxinfo | grep render
and ensuring that the output indicates that direct rendering is turned on.
2) If the hardware graphics libraries are installed, the following Linux command can be used to verify which OpenGL library file MATLAB is using:
ldd /usr/matlab/bin/glnx86/glren.so
If the appropriate hardware-specific libraries are listed, then the user should have access to graphics acceleration when running MATLAB on their client machine. If not, steps 3-5 will set up the library path to include the hardware-specific libraries.
3) Determine where the hardware-specific libGL and libGLU libraries are, for example:
/usr/lib/libGL.so
/usr/matlab/sys/opengl/lib/glnx86/libGLU.so
4) For each machine, within Linux, create a symbolic link in a single directory to these hardware graphics libraries, for example:
cd /usr/ client_hardware_graphics_lib
ln -s /usr/lib/libGL.so libGL.so
ln -s /usr/matlab/sys/opengl/lib/glnx86/libGLU.so libGLU.so
5) The library path needs to have this directory (client_hardware_graphics_lib) appended to its beginning. The appropriate path will be different based on the client machine, so the best time to update the library path would be right before MATLAB is started up. Thus, the command to start MATLAB could be wrapped in a script that executes both these commands:
setenv LD_LIBRARY_PATH /usr/ client_hardware_graphics_lib: $LD_LIBRARY_PATH
run MATLAB
These steps may be simplified if the hardware graphics acceleration libraries are located in the same local directory on each machine. Then, the setenv path would be the same for each machine, although the files would be different.
The error indicates missing libraries for x11 when attempting to open MATLAB on Linux.
If you are unable to open MATLAB with the -nodisplay flag on the Linux machine, this is another good indication of the issue. MATLAB requires x11 libraries, even if it is ran with -nodisplay flag.
To resolve the issue, please update x11 libraries.
The following command works with Ubuntu in regards to updating x11 libraries:
- First use the command sudo apt-get update -y
- Then use the command sudo apt-get install -y libx11-dev and or sudo apt-get install xorg-dev
Best Answer