1

When I start anki in my Ubuntu machine, this popups

black screen popup

So I tried starting Anki using terminal, and this is the error it shows.

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 

Specs

  • OS version - Ubuntu 20.04.2 LTS
  • Graphics - AMD Radeon RX 580 Series
  • Processor - AMD Ryzen 7 3800x 8-core processor × 16

I have tried reinstalling my graphic drivers but it didn't work.

Also I was trying to do this method, but I couldn't as I have very low experience with linux and my graphic card is AMD

I have also tried this, but it doesn't seems to work.

Aathik
  • 11
  • 1

2 Answers2

2

If you are using Anki (2.1.54 in my case) with Qt6, try enabling software rendering:

echo software > ~/.local/share/Anki2/gldriver6
daaawx
  • 247
0

Whenever I encounter error messages about missing drivers / files / shared libraries, I will try to find out which deb package the file can be found in:

apt-file search swrast_dri.so
--> libgl1-mesa-dri: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so

Then I will install that package

sudo apt install libgl1-mesa-dri

and try again.

If apt-file isn't installed, you can install it by typing

sudo apt install apt-file
apt-file update

That being said, anki is one of the very few packages I'm downloading directly from their website apps.ankiweb.net because it's a very active project. Installation instructions are provided on the same page. If you do this, make sure to remove the packaged version from your system beforehand: sudo apt remove anki

jcsjcs
  • 71
  • 4
  • I ran apt-file search swrast_dri.so and this was the output libgl1-mesa-dri: /usr/lib/x86_64-linux-gnu/dri/kms_swrast_dri.so libgl1-mesa-dri: /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so , then I apt installed libgl1-mesa-dri. Still it doesn't seems to work – Aathik May 22 '21 at 15:12
  • That's unfortunate. In that case you can still try to install the version from anki's website. They package with all/most required libraries -- that has worked well for me in the past. Another idea: do you have any plugins that could cause the issue? – jcsjcs May 22 '21 at 15:23
  • I am installing anki from the official website for the first time. – Aathik May 22 '21 at 15:26
  • You mean the problem is happening with anki installed from the official website? In that case, try installing the ubuntu package and see if that works. – jcsjcs May 22 '21 at 15:29
  • Due to some reason the profiles window works, but the main anki window doesn't work – Aathik May 22 '21 at 16:01
  • Nope, the ubuntu version also doesn't work – Aathik May 22 '21 at 16:01
  • What does this https://stackoverflow.com/a/32056721/13853882 say, I couldn't understand – Aathik May 22 '21 at 16:03