libGL, fbConfigs, visuals, swrast相关错误的解决办法

本文介绍了一种在使用PyQt5QWebEngineView时遇到的渲染网页错误,该错误与NVIDIA显卡驱动导致的libGL链接问题有关。通过重新定义软连接,将NVIDIA的libGL.so指向mesa的libGL.so,成功解决了渲染问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在用PyQt5 QWebEngineView渲染网页时出现以下错误

[0129/170028.445721:WARNING:stack_trace_posix.cc(699)] Failed to open file: /tmp/.glSisZPI (deleted)
  Error: No such file or directory
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Received signal 11 SEGV_MAPERR 000000000165
#0 0x7fe2e2ce152f <unknown>
#1 0x7fe2e1712b1d <unknown>
#2 0x7fe2e2ce1a3e <unknown>
#3 0x7fe2f2c21390 <unknown>
#4 0x7fe2692fe321 <unknown>
#5 0x7fe2e1774c09 <unknown>
#6 0x7fe2e175fc68 <unknown>
#7 0x7fe2e381d69d <unknown>
#8 0x7fe2e1a636d1 <unknown>
#9 0x7fe2e1a64ec5 <unknown>
#10 0x7fe2e3cd3a67 <unknown>
#11 0x7fe2e54ed605 <unknown>
#12 0x7fe2e2d49ee5 <unknown>
#13 0x7fe2e2d45280 <unknown>
#14 0x7fe2f2c176ba start_thread
#15 0x7fe2f294d41d clone
  r8: 0000000000000000  r9: 0000000000000000 r10: 00000000000000e9 r11: 0000000000000000
 r12: 00000000000000ad r13: 000000000000000a r14: 000000000000009a r15: 000000000000000a
  di: 00000000019d5894  si: 0000000000000001  bp: 00007fe26a7fb590  bx: 00000000019cdf50
  dx: 0000000000000019  ax: 00000000019d5880  cx: 0000000000000001  sp: 00007fe26a7fb530
  ip: 00007fe2692fe321 efl: 0000000000010202 cgf: 002b000000000033 erf: 0000000000000004
 trp: 000000000000000e msk: 0000000000000000 cr2: 0000000000000165
[end of stack trace]
Calling _exit(1). Core file will not be generated.

Google后发现原因是装了NVIDIA的显卡驱动后导致libGL链接问题,参考这里
通过重新定义软连接可以解决

sudo ln -s /usr/lib/nvidia-396/libGL.so.1 /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
我现在宿主机是gazebo11,容器中的是gazebo7,“docker run -it --rm --net=host --name=usv_sim_test \ -v $HOME/catkin_ws:/root/catkin_ws/ \ -v $HOME/.uwsim:/root/.uwsim \ -v $HOME/.gazebo:/root/.gazebo \ -v $HOME/.ros:/root/.ros \ -v /tmp/.X11-unix:/tmp/.X11-unix \ --env="DISPLAY=$DISPLAY" \ --env="XDG_SESSION_TYPE=x11" \ --env="LIBGL_ALWAYS_INDIRECT=1" \ --env="QT_X11_NO_MITSHM=1" \ usv_sim bash”运行这个命令进入容器,运行roslaunch gazebo_ros empty_world.launch命令。报错“libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast [ INFO] [1753006819.839590498]: Finished loading Gazebo ROS API Plugin. [ INFO] [1753006819.839901838]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting... libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast Error [parser.cc:581] Unable to find uri[model://sun] Error [parser.cc:581] Unable to find uri[model://ground_plane] [ INFO] [1753006825.583981226]: waitForService: Service [/gazebo/set_physics_properties] is now available. [ INFO] [1753006825.587330193, 0.001000000]: waitForService: Service [/gazebo/set_physics_properties] is now available. [ INFO] [1753006825.602925412]: Physics dynamic reconfigure ready. [ INFO] [1753006825.607386514, 0.020000000]: Physics dynamic reconfigure ready. Segmentation fault (core dumped) [gazebo_gui-3] process has died [pid 2181, exit code 139, cmd /opt/ros/kinetic/lib/gazebo_ros/gzclient __name:=gazebo_gui __log:=/root/.ros/log/22ecc86e-6553-11f0-8843-26f0ad91460e/gazebo_gui-3.log]. log file: /root/.ros/log/22ecc86e-6553-11f0-8843-26f0ad91460e/gazebo_gui-3*.log”
最新发布
07-21
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值