VLC crashes when opening any file, Ubuntu 20.04

Solution 1:

There's a bug report about that here.In fact VLC is not to blame.There's a bug in the intel driver iris_dri which is a linux Direct Rendering Infrastructure driver for the intel IRIS graphics cards.

Whenever a program tries to bypass the X server and renders directly using OpenGL on the underlying GPU , it has to use that driver indirectly.And a bug causes segmentation fault when someone issues OpenGL calls.

As suggested in the bug report , you have to use the intel driver i965 instead.In order to do that you have to define the environment variable

env MESA_LOADER_DRIVER_OVERRIDE=i965

So if you want to open VLC in the terminal , you have to add that line to your ~/.bashrc file or if you want to open it from the application menu or by clicking on a media file , you have to tamper the line beginning with Exec= in the .desktop file /usr/share/applications/vlc.desktop :

Exec=env MESA_LOADER_DRIVER_OVERRIDE=i965 /usr/bin/vlc --started-from-file %U

And if you want to set that globally for all of your applications , add this line to the file /etc/environment:

MESA_LOADER_DRIVER_OVERRIDE=i965

Solution 2:

For those like me who had no luck with Parsa Mousavi's answer, there is still one possibility: delete the ~/.config/vlc/ folder, and retry to use VLC as usual. That worked for me, at least!