当前位置:   article > 正文

软件使用:Ubuntu 22.04运行MATLAB 2020a的simulink故障报错_message service fatally disconnected

message service fatally disconnected

问题描述

Ubuntu 22.04运行MATLAB 2020a的故障报错如下:

  1. Failed to load module “canberra-gtk-module”
  2. symbol lookup error: /lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined symbol: g_memdup2
Failed to load module "canberra-gtk-module"
/home/n0name/software/matlab_2020a_install/bin/glnxa64/jcef_helper: symbol lookup error: /lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined symbol: g_memdup2
  • 1
  • 2

问题1解决

# 定位shared object 文件
n0name@xm:~$ locate libcanberra-gtk-module
/snap/gnome-3-28-1804/194/usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libcanberra-gtk-module.so
/snap/gnome-3-28-1804/198/usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libcanberra-gtk-module.so
/snap/gnome-3-38-2004/137/usr/lib/gtk-3.0/modules/libcanberra-gtk-module.so
/snap/gnome-3-38-2004/140/usr/lib/gtk-3.0/modules/libcanberra-gtk-module.so
/usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libcanberra-gtk-module.so

# GTK (GIMP Toolkit) 是一套用于创建图形用户界面的工具包
# Ubuntu22.04安装了libcanberra-gtk3-module(gtk-3.0+),而Matlab需要调用的是gtk-2.0+的canberra动态链接库

# 操作系统版本
n0name@xm:~$ uname -a
Linux xm 5.19.0-41-generic #42~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 18 17:40:00 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

# 进入/usr/lib/x86_64-linux-gnu, 发现安装的是gtk3.0+
n0name@xm:/usr/lib/x86_64-linux-gnu$ ls | grep "libcanberra*"
libcanberra-0.30
libcanberra-gtk3.so.0
libcanberra-gtk3.so.0.1.9
libcanberra-gtk.so.0
libcanberra-gtk.so.0.1.9
libcanberra.so.0
libcanberra.so.0.2.5

# 进入/usr/lib查看,发现没有canberra文件
# linux默认库是从“/usr/lib/”路径下找,而canberra动态链接库位于“/usr/lib/x86_64-linux-gnu/”路径下;

# 1. 安装gtk 2.0+的版本
sudo apt-get install libcanberra-gtk-module -y
# 2. 查看是否安装成功 查看路径:/usr/lib/x86_64-linux-gnu/gtk-2.0/modules
n0name@xm:/usr/lib/x86_64-linux-gnu/gtk-2.0/modules$ ls
libatk-bridge.so  libcanberra-gtk-module.so  libferret.so  libgail.so
n0name@xm:/usr/lib/x86_64-linux-gnu/gtk-2.0/modules$ 

# 3. 创建软链接
sudo ln -s /usr/lib/x86_64-linux-gnu/gtk-2.0/modules/libcanberra-gtk-module.so /usr/lib/libcanberra-gtk-module.so

# 以上为解决 Failed to load module "canberra-gtk-module" 问题

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40

问题2解决

# 打开MATLAB后在命令行输入:
# 1. 查看版本
>> version

ans =

    '9.8.0.1323502 (R2020a)'
# 2. 查看安装路径
>> cd(matlabroot)
>> pwd

ans =

    '/home/n0name/software/matlab_2020a_install'
# 3. 查看问题
>> !bin/glnxa64/MATLABWindow
bin/glnxa64/MATLABWindow: symbol lookup error: /lib/x86_64-linux-gnu/libpango-1.0.so.0: undefined symbol: g_memdup2
# 4. 解决以上问题

# 在 bash terminal中
# 进入 <安装路径>/cefclient/sys/os/glnxa64
cd ~/software/matlab_2020a_install/cefclient/sys/os/glnxa64
# 创建文件夹
sudo mkdir exclude
# 移动白色的文件
sudo mv libgio-2.0.so* exclude
sudo mv libglib-2.0.so* exclude
sudo mv libgmodule-2.0.so* exclude
sudo mv libgobject-2.0.so* exclude
sudo mv libgthread-2.0.so* exclude
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

参考回答:
在这里插入图片描述

问题3

  • 问题:Error using opengl Switching to software OpenGL rendering at runtime on unix is not supported(Warning: MATLAB has disabled some advanced graphics rendering features by switching to software
    OpenGL.)
  • 并且经常显示message service fatally disconnected

解决:
1.
在这里插入图片描述
2.
在这里插入图片描述

问题4

>> opengl hardware
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.
  • 1
  • 2
  • 3
  • 4
  • 5
gfx12 and newer are not supported on i965
libGL error: glx: failed to create dri3 screen
libGL error: failed to load driver: i965
gfx12 and newer are not supported on i965
libGL error: glx: failed to create dri2 screen
libGL error: failed to load driver: i965
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
gfx12 and newer are not supported on i965
libGL error: glx: failed to create dri3 screen
libGL error: failed to load driver: i965
gfx12 and newer are not supported on i965
libGL error: glx: failed to create dri2 screen
libGL error: failed to load driver: i965
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast
gfx12 and newer are not supported on i965
libGL error: glx: failed to create dri3 screen
libGL error: failed to load driver: i965
gfx12 and newer are not supported on i965
libGL error: glx: failed to create dri2 screen
libGL error: failed to load driver: i965
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libGL error: failed to load driver: swrast

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
libGL error: failed to load driver: i965

n0name@xm:~$ locate i965_dri.so
/snap/gnome-3-28-1804/194/usr/lib/x86_64-linux-gnu/dri/i965_dri.so
/snap/gnome-3-28-1804/198/usr/lib/x86_64-linux-gnu/dri/i965_dri.so
/snap/gnome-3-38-2004/137/usr/lib/x86_64-linux-gnu/dri/i965_dri.so
/snap/gnome-3-38-2004/140/usr/lib/x86_64-linux-gnu/dri/i965_dri.so
/usr/lib/x86_64-linux-gnu/dri/i965_dri.so

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 后来替换成: opengl('save','software')
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/185131?site
推荐阅读
相关标签
  

闽ICP备14008679号