setup of Matlab R2021a on Linux Mint with GPU acceleration

조회 수: 11 (최근 30일)
LeChat
LeChat 2021년 4월 19일
답변: Muskan 2024년 10월 30일
Hi,
I just installed Linux Mint 20.1 on my computer (ThinkPad P51 with Nvidia Quadro 2200m).
I have issues regarding Matlab and also regarding the detecting the GPU.
After I boot my computer, I open the terminal and launch Matlab using the command
matlab $
Then Matlab opens but this appears in the Terminal:
libGL error: MESA-LOADER: failed to open iris (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open iris (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: swrast
libGL error: MESA-LOADER: failed to open iris (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open iris (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: swrast
and in the command line window in Matlab, this message is displayed:
com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x12660792, isOwner false, <455ae5c1, 28f5776a>[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: com.jogamp.opengl.GLException: AWT-EventQueue-0-SharedResourceRunner: Unable to create temp OpenGL context(1)
at jogamp.opengl.x11.glx.X11GLXContext.createImpl(X11GLXContext.java:368)
at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:759)
at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:642)
at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:580)
at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:297)
... 2 more
Warning: Unable to create com.mathworks.mde.liveeditor.LiveEditorClient, for details see
/home/adrien/MATLABDesktopCreateError.log
I found that I need to run the following in the Terminal in order for this message to disappear:
export MESA_LOADER_DRIVER_OVERRIDE=i965
Then I launch Matlab again and check if it is using the dedicated GPU of my computer:
>> gpuDevice
Error using gpuDevice (line 26)
Unable to find a supported GPU device. For more information on GPU support, see GPU Support by Release.
Is there anything I can do to solve this issue?
Also, if I reboot the computer, the initial error comes back and I need to
export MESA_LOADER_DRIVER_OVERRIDE=i965
again in order to make the first error message disappear.
Thank you for your help.
PS: other infos:
$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ lspci | grep -i nvidia
01:00.0 3D controller: NVIDIA Corporation GM206GLM [Quadro M2200 Mobile] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GM206 High Definition Audio Controller (rev a1)
$ uname -m && cat /etc/*release
x86_64
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=20.1
DISTRIB_CODENAME=ulyssa
DISTRIB_DESCRIPTION="Linux Mint 20.1 Ulyssa"
NAME="Linux Mint"
VERSION="20.1 (Ulyssa)"
ID=linuxmint
ID_LIKE=ubuntu
PRETTY_NAME="Linux Mint 20.1"
VERSION_ID="20.1"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=ulyssa
UBUNTU_CODENAME=focal
cat: /etc/upstream-release: Is a directory
$ uname -r
5.4.0-72-generic

답변 (1개)

Muskan
Muskan 2024년 10월 30일
Hi,
Ensure that you have followed the steps outlined on the following documentation page, especially the part about updating the graphics drivers and the statement: "On Linux® systems, use proprietary vendor drivers instead of open-source replacements.
If this error ever appears for Software OpenGL, please try adding both of the following environment variables in a Linux terminal.
export MESA_LOADER_DRIVER_OVERRIDE=i915;
export GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0
The "MESA_LOADER_DRIVER_OVERRIDE" variable may vary from machine to machine (match to display driver which could be "i965" or "i915". These environment variables may help decrease the amount of error messages
I hope this helps!

카테고리

Help CenterFile Exchange에서 Get Started with GPU Coder에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by