When I try and run some of the samples in 5_Simulations (e.g. nbody or particles) I get the following error
Required OpenGL extensions missing.
I’m on Ubuntu 20.04 in WSL2, using VcXsrv and have done export DISPLAY=`grep -oP "(?<=nameserver ).+" /etc/resolv.conf`:0.0
and export LIBGL_ALWAYS_INDIRECT=1
Can someone provide further information about which extensions I need to install? (I’m not familiar with OpenGL)
The error originates the following function in e.g. particles.cpp
, which is called by main()
fairly early on.
// initialize OpenGL
void initGL(int *argc, char **argv)
{
glutInit(argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutInitWindowSize(width, height);
glutCreateWindow("CUDA Particles");
if (!isGLVersionSupported(2,0) ||
!areGLExtensionsSupported("GL_ARB_multitexture GL_ARB_vertex_buffer_object"))
{
fprintf(stderr, "Required OpenGL extensions missing.");
exit(EXIT_FAILURE);
}
#if defined (WIN32)
if (wglewIsSupported("WGL_EXT_swap_control"))
{
// disable vertical sync
wglSwapIntervalEXT(0);
}
#endif
glEnable(GL_DEPTH_TEST);
glClearColor(0.25, 0.25, 0.25, 1.0);
glutReportErrors();
}