0

I work on Ubuntu 20.04.

I updated graphics drivers and restarted X. I had to upgrade OpenGL since after upgrading drivers the OpenGL version was downgraded for some reason. I opened bash terminal and updated the drivers as described here:

sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt update
sudo apt upgrade

Now, when I run glxinfo | grep "OpenGL version" either on terminal opened from VSCode or from Ubuntu itself it shows version 4.5.

user@user:~$ glxinfo | grep "OpenGL version"
OpenGL version string: 4.5 (Compatibility Profile) Mesa 23.1.0 - kisak-mesa PPA

But, when I open the terminal from Qt Creator it shows version 3.1

user@user:~$ glxinfo | grep "OpenGL version"
OpenGL version string: 3.1 Mesa 21.2.6

How this even possible?

Rabbid76
  • 202,892
  • 27
  • 131
  • 174
theateist
  • 13,879
  • 17
  • 69
  • 109

1 Answers1

3

Qt Creator has its own environment variables that it loads when building a project.

LD_LIBRARY_PATH and LIBGL_DRIVERS_PATH had paths to /snap/qtcreator-.../usr/lib/x86_64-linux-gnu/dri which has older graphics driver libraries than in /usr/lib/.../dri. When the terminal from Qt Creator started, it looked for drivers there and not in /usr/lib/... where new drivers werer installed.

Once I removed that /snap/... it allowed Qt Creator to look for OpenGL libraries in the default location /usr/lib/... where new dirvers where installed.

theateist
  • 13,879
  • 17
  • 69
  • 109