我的配置:

t@t:/$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:    16.04
Codename:   xenial

我尝试运行与libGL一起使用的QTCreator,它崩溃并显示以下错误:
t@t:/$LIBGL_DEBUG=verbose qtcreator

(qtcreator:14537): Gtk-WARNING **: Impossible de trouver le moteur de thème dans module_path : « adwaita »

(qtcreator:14537): Gtk-WARNING **: Impossible de trouver le moteur de thème dans module_path : « adwaita »
libGL: pci id for fd 22: 1002:67ef, driver radeonsi
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/radeonsi_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so
libGL: dlopen /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so failed (/usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so: undefined symbol: amdgpu_query_sensor_info)
libGL: OpenDriver: trying ${ORIGIN}/dri/tls/radeonsi_dri.so
libGL: OpenDriver: trying ${ORIGIN}/dri/radeonsi_dri.so
libGL: dlopen ${ORIGIN}/dri/radeonsi_dri.so failed (/usr/bin/../lib/x86_64-linux-gnu/qtcreator/../dri/radeonsi_dri.so: undefined symbol: amdgpu_query_sensor_info)
libGL: OpenDriver: trying /usr/lib/dri/tls/radeonsi_dri.so
libGL: OpenDriver: trying /usr/lib/dri/radeonsi_dri.so
libGL: dlopen /usr/lib/dri/radeonsi_dri.so failed (/usr/lib/dri/radeonsi_dri.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL: pci id for fd 22: 1002:67ef, driver radeonsi
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/radeonsi_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so
libGL: dlopen /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so failed (/usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so: undefined symbol: amdgpu_query_sensor_info)
libGL: OpenDriver: trying ${ORIGIN}/dri/tls/radeonsi_dri.so
libGL: OpenDriver: trying ${ORIGIN}/dri/radeonsi_dri.so
libGL: dlopen ${ORIGIN}/dri/radeonsi_dri.so failed (/usr/bin/../lib/x86_64-linux-gnu/qtcreator/../dri/radeonsi_dri.so: undefined symbol: amdgpu_query_sensor_info)
libGL: OpenDriver: trying /usr/lib/dri/tls/radeonsi_dri.so
libGL: OpenDriver: trying /usr/lib/dri/radeonsi_dri.so
libGL: dlopen /usr/lib/dri/radeonsi_dri.so failed (/usr/lib/dri/radeonsi_dri.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so
libGL: dlopen /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so failed (/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so: undefined symbol: amdgpu_query_sensor_info)
libGL: OpenDriver: trying ${ORIGIN}/dri/tls/swrast_dri.so
libGL: OpenDriver: trying ${ORIGIN}/dri/swrast_dri.so
libGL: dlopen ${ORIGIN}/dri/swrast_dri.so failed (/usr/bin/../lib/x86_64-linux-gnu/qtcreator/../dri/swrast_dri.so: undefined symbol: amdgpu_query_sensor_info)
libGL: OpenDriver: trying /usr/lib/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib/dri/swrast_dri.so
libGL: dlopen /usr/lib/dri/swrast_dri.so failed (/usr/lib/dri/swrast_dri.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
QQuickWidget: Failed to make context current
QQuickWidget::resizeEvent() no OpenGL context

我运行glxgears,它可以工作(我看到车轮在移动),并且显示了它使用的驱动程序:
t@t:/$ LIBGL_DEBUG=verbose glxgears -info
libGL: DRI3 is disabled, try running in DRI2 mode.
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/amdgpu_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so
GL_RENDERER   = AMD Radeon (TM) RX 460 Graphics
GL_VERSION    = 4.5.13453 Compatibility Profile Context 16.40.5
GL_VENDOR     = ATI Technologies Inc.

我试图建立一个符号链接(symbolic link),以使QTCreator使用与glxgears相同的库:
t@t:/$ sudo mv /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so.old
t@t:/$ sudo ln -s /usr/lib/x86_64-linux-gnu/dri/amdgpu_dri.so /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so
t@t:/$ LIBGL_DEBUG=verbose qtcreator

(qtcreator:22657): Gtk-WARNING **: Impossible de trouver le moteur de thème dans module_path : « adwaita »

(qtcreator:22657): Gtk-WARNING **: Impossible de trouver le moteur de thème dans module_path : « adwaita »
libGL: pci id for fd 22: 1002:67ef, driver radeonsi
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/radeonsi_dri.so
libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so
Erreur de segmentation (core dumped)

这是我所有的libGL.so文件:
t@t:/$ find /usr -iname "*libGL.so*" -exec ls -l -- {} +
lrwxrwxrwx 1 root root     14 janv. 29 20:49 /usr/lib/i386-linux-gnu/mesa/libGL.so.1 -> libGL.so.1.2.0
-rw-r--r-- 1 root root 453128 janv. 29 20:50 /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
lrwxrwxrwx 1 root root     13 janv. 29 21:07 /usr/lib/x86_64-linux-gnu/libGL.so -> mesa/libGL.so
lrwxrwxrwx 1 root root     16 févr.  6 06:37 /usr/lib/x86_64-linux-gnu/libGL.so.1 -> libGL.so.renamed
lrwxrwxrwx 1 root root     13 janv. 13 09:41 /usr/lib/x86_64-linux-gnu/libGL.so.renamed -> mesa/libGL.so
lrwxrwxrwx 1 root root     14 janv. 29 21:07 /usr/lib/x86_64-linux-gnu/mesa/libGL.so -> libGL.so.1.2.0
lrwxrwxrwx 1 root root     14 janv. 29 21:07 /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 -> libGL.so.1.2.0
-rw-r--r-- 1 root root 467520 janv. 29 21:08 /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0

那么,如何使用与glxgears相同的libGL库来使QTCreator成为可能?

最佳答案

删除符号链接(symbolic link)以避免出现分段问题,请尝试安装此链接:

apt-get intall -y mesa-utils and libgl1-mesa-glx

09-12 21:09