Required OpenGL extensions missing / code=304(cudaErrorOperatingSystem) "cudaGraphicsGLRegisterBuffer(...)"

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();
}
1 Like

UPDATE

If I untick native opengl when launching VcXsrv and do not export LIBGL_ALWAYS_INDIRECT=1 then I no longer see the Required OpenGL extensions missing. error.

… but running ./particles now crashes immediately after a CUDA Particles window opens with

CUDA error at particleSystem_cuda.cu:78 code=304(cudaErrorOperatingSystem) "cudaGraphicsGLRegisterBuffer(cuda_vbo_resource, vbo, cudaGraphicsMapFlagsNone)"

(however, running ./particles -benchmark runs normally. Similarly, I get the same error with ./nbody, but ./nbody -hostmem runs normally)

I am using a Quadro P1000 with the Quadro graphics driver v465.12 with CUDA toolkit v11.1 and on Windows build 20277.1

Same error has been reported previously on the samples github repo CUDA tested by nbody with errors · Issue #28 · NVIDIA/cuda-samples · GitHub

1 Like

I just did a full clean install of the NVIDIA 11.4 to the Centos 7.9, fresh from the install disk. I performed the install per instructions. I get the message when I try to run the executable 5_Simulations/smokeParticles that:

The following required OpenGL extensions missing:
GL_ARB_multitexture
GL_ARB_vertex_buffer_object
GL_EXT_geometry_shader4

I do not get the smokeParticles demo. As a related note, doing the install with version 7.5 of the old coda toolkit with Centos 7.2 works fine and that is the same HP Zbook G3 with the Quadra M1000M.

Anyone know the answer to this as I see the same questions scattered in different places. Any help or pointers would be appreciated. Thanks!

First of all… Running nbody simulation on WSL2 requires a few steps.
Since you mentioned that you are using “VcXsrv” I assume you did set up $DISPLAY part on your .bashrc make sure to set zero.

for X11 forwarding to Windows10

export DISPLAY=$(ip route list default | awk ‘{print $3}’):0.0
export LIBGL_ALWAYS_INDIRECT=0

  1. Make sure you can run glxgears

default OpenGL version in WSL2 would be 1.4 which need to be upgraded

  1. Upgrade OpenGL version
    Thanks to Oibaf’s PPA
    sudo add-apt-repository ppa:oibaf/graphics-drivers
    sudo apt-get install mesa-vdpau-drivers
    sudo apt-get update

  2. Avoid segmentation fault by storing data into host memory
    ./nbody -hostmem


    Enjoy a beautiful N-body simulation calculated WSL2 using GTX graphic card on your laptop and the resulting graphic will be ported toward Windows 10.

When I execute GitHub Samples cloned from GitHub on Windows 10, I get the following error:

ERROR: Support for necessary OpenGL extensions missing.

Is this caused by my old graphics card or the graphics card driver provided by Windows 10 or CUDA Toolkit or GitHub samples?

I was using CUDA 11.6, and gitHub Samples were working until around July 2022. This problem stated when I installed CUDA11.8. Although I reinstalled CUDA 11.8, this problem still occurs.

What do you think is the cause of this problem?

Is this caused by my old graphics card or the graphics card driver provided by Windows 10 or CUDA Toolkit or GitHub samples?

I was using CUDA 11.6, and GitHub Samples were working until around July 2022. The problem started when I installed CUDA11.8. Although I reinstalled CUDA 11.6, this problem still occurs.

I am testing by using two machines.

SkyTech Gaming does not have this problem. Its GPU is Nvidia GeForce GTX 1600 super 8GB, but Tesla T4 which I want to test cannot be mounted on this machine.

The problem occurs with Z270-tomahawk-Arctic. Its GPU is NVIDIA GeForceGT 720 whose driver was provided in 2014.
This GPU is no longer supported by NVIDIA and cannot be used by CUDA according to TeckPowerup GPU-Z.