clEnqueueAcquireGLObjects() access violation

I’m Implementing OpenCL-OpenGL interop in my project to generate VBO from OpenCL Kernels.

I keep getting an access violation when I run clEnqueueAcquireGLObjects() with my Nvidia RTX4080 (mobile) card on Windows10.

I have the cl_context_properties set like so:

properties[0] = CL_GL_CONTEXT_KHR;
properties[1] = (cl_context_properties)wglGetCurrentContext();
properties[2] = CL_WGL_HDC_KHR;
properties[3] = (cl_context_properties)wglGetCurrentDC();
properties[4] = CL_CONTEXT_PLATFORM;
properties[5] = (cl_context_properties)platform_id;
properties[6] = 0;

Verify my device is supported using clGetGLContextInfoKHR and CL_DEVICES_FOR_GL_CONTEXT_KHR:

bool deviceSupportsExternGL(cl_device_id pDevice, cl_context_properties* props) {
    size_t bytes = 0;
    pclGetGLContextInfoKHR(props, CL_DEVICES_FOR_GL_CONTEXT_KHR, 0, NULL, &bytes);
    size_t devNum = bytes / sizeof(cl_device_id);
    cl_device_id* devices = new cl_device_id[devNum];
    pclGetGLContextInfoKHR(props, CL_DEVICES_FOR_GL_CONTEXT_KHR, bytes, devices, NULL);
    bool res = false;
    for (size_t i = 0; i < devNum; i++)
    {
        if (devices[i] == pDevice) {
            res = true;
            break;
        }
    }
    delete[] devices;
    return res;
}

Create my gl_cl buffer successfully:

unsigned int Graphics::CreateBufferGL(int size, const float* data, unsigned int usage)
{
	GLuint ret_val = 0;
	glGenBuffers(1, &ret_val);
	glBindBuffer(GL_ARRAY_BUFFER, ret_val);
	glBufferData(GL_ARRAY_BUFFER, size * sizeof(float), data, usage);
	glBindBuffer(GL_ARRAY_BUFFER, 0);
	return ret_val;
}


cl_int res = 0;
float* tmp_buff = new float[mSize];
gl_buff = Graphics::CreateBufferGL(mSize, tmp_buff, CL_GL_DYNAMIC_DRAW);
cl_gl_buff = clCreateFromGLBuffer(context, CL_MEM_READ_WRITE, gl_buff, &res);
delete[] tmp_buff;

but when I actually try to acquire the the GLObjects with clEnqueueAcquireGLObjects(), I get an access violation:

void ComputeBuffer::FlushExternal()
{
    cl_event finished_event = 0;
    int num_wait_events = (g_wait_event == NULL) ? 0 : 1;
    cl_event* wait_event_ptr = (g_wait_event == NULL) ? NULL : &g_wait_event;

    //clEnqueueAcquireGLObjects(command_queue, 1, &cl_gl_buff, num_wait_events, wait_event_ptr, &finished_event);
    clEnqueueAcquireGLObjects(command_queue, 1, &cl_gl_buff, 0, NULL, &finished_event);
    g_wait_event = finished_event;
    clWaitForEvents(1, &g_wait_event);


    clEnqueueCopyBuffer(command_queue, buffer, cl_gl_buff, 0, 0, mSize, num_wait_events, wait_event_ptr, &finished_event);
    g_wait_event = finished_event;

    clEnqueueReleaseGLObjects(command_queue, 1, &cl_gl_buff, 0, NULL, NULL);
}

Unable to test to see if this works with my Intel integrated graphics as the cl_khr_gl_sharing extension isn’t supported.