M1 Crash With Irrlicht + OpenGL

28 views
Skip to first unread message

Henkie

unread,
Jan 12, 2023, 9:10:38 AM1/12/23
to ProjectChrono
Hi all,

I've been struggling to run reliably with Irrlicht and OpenGL on a Mac M1, does anyone face a similar issue? Sometimes it launches fine, but often I get a segfault or bus error in the following part:

m_device_params.DriverType = irr::video::EDT_OPENGL;
m_device = irr::createDeviceEx(m_device_params);

In ChVisualSystemIrrlicht.cpp

"""
void ChVisualSystemIrrlicht::Initialize() {
if (m_device)
return;

// Create Irrlicht device using current parameter values.
m_device = irr::createDeviceEx(m_device_params);
if (!m_device) {
std::cerr << "Cannot use default video driver - fall back to OpenGL" << std::endl;
m_device_params.DriverType = irr::video::EDT_OPENGL;

m_device = irr::createDeviceEx(m_device_params);
if (!m_device) {
std::cerr << "Failed to create the video driver - giving up" << std::endl;
return;
}
}
"""

Thank you in advance for any suggestions!

Henkie

unread,
Jan 13, 2023, 1:38:33 AM1/13/23
to ProjectChrono
Forcing it to directly use OpenGL instead of trying to use the default device seems to have resolved the crash:

For those interested, change the code above as follows:

void ChVisualSystemIrrlicht::Initialize() {
if (m_device)
return;

// Create Irrlicht device using current parameter values.
m_device_params.DriverType = irr::video::EDT_OPENGL;

m_device = irr::createDeviceEx(m_device_params);
if (!m_device) {
std::cerr << "Failed to create the video driver - giving up" << std::endl;
return;
}
Reply all
Reply to author
Forward
0 new messages