When I start anki in my Ubuntu machine, this popups
When I try to open it in terminal the following error message is coming
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
Qt warning: QQuickWidget: Failed to make context current
Qt warning: QQuickWidget::resizeEvent() no OpenGL context
Qt warning: QQuickWidget: Failed to make context current
Qt warning: QQuickWidget: Failed to make context current
Qt warning: QQuickWidget::resizeEvent() no OpenGL context
Qt warning: QQuickWidget: Failed to make context current
Xlib: sequence lost (0x102d1 > 0x2d3) in reply type 0x0!
Xlib: sequence lost (0x102d4 > 0x2d6) in reply type 0x0!
Qt warning: QQuickWidget: Failed to make context current
Qt warning: QQuickWidget::resizeEvent() no OpenGL context
Qt warning: QQuickWidget: Failed to make context current
[21404:21447:0520/120313.269102:ERROR:context_group.cc(292)] ContextResult::kFatalFailure: too few texture units supported (0, should be 8).
Qt warning: QQuickWidget: Attempted to render scene with no context
Qt warning: QQuickWidget: Attempted to render scene with no context
Qt warning: QQuickWidget: Attempted to render scene with no context
[21461:7:0520/120313.271585:ERROR:command_buffer_proxy_impl.cc(144)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.
[21404:21447:0520/120313.291113:ERROR:context_group.cc(292)] ContextResult::kFatalFailure: too few texture units supported (0, should be 8).
Qt warning: QQuickWidget::invalidateRenderControl could not make context current
Qt warning: QQuickWidget::invalidateRenderControl could not make context current
Qt warning: QQuickWidget::invalidateRenderControl could not make context current
OS version - Ubuntu 20.04.2 LTS
Graphics - Radeon RX 580 Series
Processor - AMD® Ryzen 7 3800x 8-core processor × 16
I have tried searching on Google and tried this, but it didn’t work.
Also I reinstalled my graphic drivers to see whether it works, but it didn’t
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: OpenDriver: trying /usr/X11R6/lib64/modules/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/X11R6/lib64/modules/dri/swrast_dri.so
libGL: dlopen /usr/X11R6/lib64/modules/dri/swrast_dri.so failed (/usr/X11R6/lib64/modules/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
libGL: OpenDriver: trying /usr/lib64/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib64/dri/swrast_dri.so
libGL: dlopen /usr/lib64/dri/swrast_dri.so failed (/usr/lib64/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
libGL: OpenDriver: trying /usr/X11R6/lib/modules/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/X11R6/lib/modules/dri/swrast_dri.so
libGL: dlopen /usr/X11R6/lib/modules/dri/swrast_dri.so failed (/usr/X11R6/lib/modules/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
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: cannot open shared object file: No such file or directory)
libGL: OpenDriver: trying /usr/X11R6/lib32/modules/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/X11R6/lib32/modules/dri/swrast_dri.so
libGL: dlopen /usr/X11R6/lib32/modules/dri/swrast_dri.so failed (/usr/X11R6/lib32/modules/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
libGL: OpenDriver: trying /usr/lib32/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib32/dri/swrast_dri.so
libGL: dlopen /usr/lib32/dri/swrast_dri.so failed (/usr/lib32/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
Qt warning: QQuickWidget: Failed to make context current
Qt warning: QQuickWidget::resizeEvent() no OpenGL context
Qt warning: QQuickWidget: Failed to make context current
Qt warning: QQuickWidget: Failed to make context current
Qt warning: QQuickWidget::resizeEvent() no OpenGL context
Qt warning: QQuickWidget: Failed to make context current
Xlib: sequence lost (0x102bb > 0x2bf) in reply type 0x0!
Qt warning: QQuickWidget: Failed to make context current
Qt warning: QQuickWidget::resizeEvent() no OpenGL context
Qt warning: QQuickWidget: Failed to make context current
[5013:5055:0522/160354.584581:ERROR:context_group.cc(292)] ContextResult::kFatalFailure: too few texture units supported (0, should be 8).
Qt warning: QQuickWidget: Attempted to render scene with no context
Qt warning: QQuickWidget: Attempted to render scene with no context
Qt warning: QQuickWidget: Attempted to render scene with no context
[5069:7:0522/160354.586989:ERROR:command_buffer_proxy_impl.cc(144)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.
[5013:5055:0522/160354.600715:ERROR:context_group.cc(292)] ContextResult::kFatalFailure: too few texture units supported (0, should be 8).
Qt warning: QQuickWidget::invalidateRenderControl could not make context current
Qt warning: QQuickWidget::invalidateRenderControl could not make context current
Qt warning: QQuickWidget::invalidateRenderControl could not make context current
Do you have proprietary or open source AMD drivers? Installing proprietary drivers can break the installation of libGL, in the sense that the drivers are installed, but the links that point to them are replaced with broken links.
If you do have proprietary drivers, I suggest you try installing open source ones.
Your environment contains information which allows programs to fetch resources. LD_LIBRARY_PATH is an environment variable that provides information about where to fetch shared objects (the .so files).
The guy would posted says he provided the wrong paths, therefore preventing programs fetching the resources at the good place (to be more specific, he added /usr/lib and /usr/lib64 to LD_LIBRARY_PATH, whereas the .so file was in the /usr/X11R6/lib directory).
When he removed the wrong paths, his programs were able to fetch the resources (it is not completely clear to me why removing paths would actually allow programs to find resources in other paths, but whatever…).
However, from the logs you posted, you can see that in your case libGL tries to fetch the resource (swrast_dri.so) in many directories, including /usr/X11R6/lib, but fails to find it in all of them. Furthermore, you have no problems in loading libGL.so, you have problems loading swrast_dri.so, which is a subcomponent of the libGL library.