QmlProfiler : Plugin initialization failed: Cannot create OpenGL context

Viewed 1322

I use Qt 6.2.2 in ubuntu 20.04 and I install OpenGL like this:

sudo apt install libgl1-mesa-dev

After I install my graphics card driver (NVDI 470.86) I get this error each time I open QtCreator IDE.

why did this happen and how can I fix this?

I cant compile examples that use qt quick like Qt Quick 3D - Custom Materials Example

QML debugging is enabled. Only use this in a safe environment. qt.quick3d.general: Unable to find ideal GL version. QGLXContext: Failed to create dummy context QRhiGles2: Failed to create temporary context QRhiGles2: Failed to create context Failed to create RHI (backend 2) Failed to initialize graphics backend for OpenGL.

output pictures:

picture error 1

picture error 2

output from glxinfo | egrep -i version

enter image description here

2 Answers

I understand that qt creator save its settings in /home/username/.config/QtProject and It understand OpenGL from there.

So I delete my .config folder and reboot my system and let my OS create it again this Fix my problem but as @merosss said that he change his usermod to the video that was one way because qt creator will create it in that path and problem will fix again.

Since I install the NVIDIA driver it seems that Qt cant understand which OpenGL should use and that problem happens.

Had the same problem since this morning. Not sure why this worked (any contribution is appreciated), but I solved it by adding my user to the video group and rebooting:

sudo usermod -a -G video *username*
Related