Hi :)
I ran Nsight’s performance analysis on my OpenCL+OpenGL app and in the results I see this:
Here’s how I init OpenCL:
std::vector<cl::Platform> all_platforms;
cl::Platform::get(&all_platforms);
auto default_platform = all_platforms[1];
cout << "Using platform: " << default_platform.getInfo<CL_PLATFORM_NAME>() << std::endl;
std::vector<cl::Device> devices;
default_platform.getDevices(CL_DEVICE_TYPE_GPU, &devices);
for (unsigned d = 0; d < devices.size(); ++d) {
if (checkExtnAvailability(devices[d], CL_GL_SHARING_EXT)) {
device = devices[d];
break;
}
}
cout << "Using device: " << device.getInfo<CL_DEVICE_NAME>() << std::endl;
cl_context_properties props[] =
{
CL_GL_CONTEXT_KHR, (cl_context_properties)wglGetCurrentContext(),
CL_WGL_HDC_KHR, (cl_context_properties)wglGetCurrentDC(),
CL_CONTEXT_PLATFORM, (cl_context_properties)default_platform(),
0
};
context = cl::Context(device, props);
I get this output:
Using platform: NVIDIA CUDA
Using device: GeForce 940MX
Also, I print GL’s info like this:
cout << "GL info: " << glGetString(GL_VENDOR) << "; " << glGetString(GL_VERSION) << endl;
and I get:
GL info: NVIDIA Corporation; 3.2.0 NVIDIA 411.63
Any idea what’s broken? My GeForce driver is the exact recommended version for Nsight.
Note: I do have CUDA Toolkit 10.0 installed.