Skip to content
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

Make webots run in the Windows CI machine #4691

Closed
wants to merge 12 commits into from

Conversation

omichel
Copy link
Member

@omichel omichel commented Jun 20, 2022

Investigating why webots --sysinfo crashes in the Windows CI machines.

@omichel omichel self-assigned this Jun 20, 2022
@omichel omichel added bug Something isn't working test suite Start the test suite labels Jun 20, 2022
@omichel
Copy link
Member Author

omichel commented Jun 20, 2022

It turns out that the crash is due to OpenGL initialization:

// create simply an OpenGL context
QMainWindow mainWindow;
QGLWidget glWidget(&mainWindow);
mainWindow.setCentralWidget(&glWidget);
mainWindow.show();
// An OpenGL context is required there for the OpenGL calls like `glGetString`.
// The format is QSurfaceFormat::defaultFormat() => OpenGL 3.3 defined in main.cpp.
QOpenGLContext *context = new QOpenGLContext();
context->create();
QOpenGLFunctions *gl = context->functions(); // QOpenGLFunctions_3_3_Core cannot be initialized here on some systems like
// macOS High Sierra and some Ubuntu environments.
#ifdef _WIN32
const quint32 vendorId = WbSysInfo::gpuVendorId(gl);
const quint32 rendererId = WbSysInfo::gpuDeviceId(gl);
#else
const quint32 vendorId = 0;
const quint32 rendererId = 0;
#endif
const char *vendor = (const char *)gl->glGetString(GL_VENDOR);
const char *renderer = (const char *)gl->glGetString(GL_RENDERER);
// cppcheck-suppress knownConditionTrueFalse
if (vendorId == 0)
cout << tr("OpenGL vendor: %1").arg(vendor).toUtf8().constData() << endl;
else
cout << tr("OpenGL vendor: %1 (0x%2)").arg(vendor).arg(vendorId, 0, 16).toUtf8().constData() << endl;
// cppcheck-suppress knownConditionTrueFalse
if (rendererId == 0)
cout << tr("OpenGL renderer: %1").arg(renderer).toUtf8().constData() << endl;
else
cout << tr("OpenGL renderer: %1 (0x%2)").arg(renderer).arg(rendererId, 0, 16).toUtf8().constData() << endl;
cout << tr("OpenGL version: %1").arg((const char *)gl->glGetString(GL_VERSION)).toUtf8().constData() << endl;
delete context;

Critical: Failed to load opengl32sw (The specified module could not be found.)
Warning: Failed to load and resolve WGL/OpenGL functions
Critical: Failed to load opengl32sw (The specified module could not be found.)
Critical: Failed to load opengl32sw (The specified module could not be found.)
Warning: QOpenGLWidget: Failed to create context
Critical: Failed to load opengl32sw (The specified module could not be found.)
Warning: Failed to load and resolve WGL/OpenGL functions
Warning: QOpenGLFunctions created with non-current context

@omichel omichel changed the title Display error message if OpenAL initialization fails Make webots run in the Windows CI machine Jun 20, 2022
@omichel omichel closed this Jun 21, 2022
@omichel omichel deleted the fix-openal-initialization-on-windows-ci branch September 27, 2022 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test suite Start the test suite
Development

Successfully merging this pull request may close these issues.

1 participant