-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GL] Fix: Intel graphics on linux now overrides the core profile context #526
[GL] Fix: Intel graphics on linux now overrides the core profile context #526
Conversation
#ifdef __linux__ | ||
::setenv("MESA_GL_VERSION_OVERRIDE", "3.0", 1); | ||
#endif // __linux | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, this will be applied even if you have an AMD or Nvidia gpu.
Can we specify when we have to apply it ? Like :
if(glGetString( GL_VENDOR )=="Intel Open Source Technology Center") ::setenv("MESA_GL_VERSION_OVERRIDE", "3.0", 1);
Let me know if it's overkill :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi and thanks for your comment!
It would indeed be cleaner to check for Intel's hardware before setting this env variable.
The only issue is that I haven't found (nor looked that much yet..) a way of doing so.
Calling glGetString is, to my knowledge, only possible once the OpenGL context is created (?). Thus I would have to create a dummy gl context, probe the glVendor variable, destroy the dummy context, set the env variable, and then only let Qt create its OpenGL context.
This is quite heavy...
If you guys have an idea how to do this cleanly, I'm all ears :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right for the opengl context.
I don't know how to properly do it.
Well, it looks overkill :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.. :) Maybe someone else has an idea how to do this in a better way.
I'm setting this PR back to 'to review' until someone finds an acceptable approach to check for the GPU model / vendor
Hello @bruno-marques After some thinking about that I'm more convinced now that the best approach is to simply display a warning message like that: if( isIntelraphics() )
{
msg_error("runSofa") << "Intel drivers have a problem ...with ..... to runSofa you need to set your manually set an environment variable named 'MESA_GL_VERSION_OVERRIDE' with the value '3.0' to fix the problem.";
exit(-1);
} |
…hout MESA_GL_VERSION_OVERRIDE=3.0 on Linux with Intel GC.
Sorry for taking so much time to finish this. I think we could still merge that one with the 17.12, once the checks are passed..? :) |
I think this one is ready. |
fixing #238
This fix solves the segfault at startup that intel-powered linux machines experience.
It should be a linux-specific bugfix to my understanding.
If anyone knows a clean way of probing whether or not a "Core profile" context would be created (something better than parsing lspci to see if we're runing an intel GPU...), I'll update this PR accordingly
Anyone to review?
This PR:
Reviewers will merge only if all these checks are true.