I am a student working to get some older OpenCL code running. It is an application that uses Matlab mex functions to call some C++. A Matlab script compiles the C++ code, then runs it to get the OpenCL stuff going.
The first OpenCL function called is
err = clGetPlatformIDs(0, 0, &nplatforms);
My understanding is that this should put the number of platforms in nplatforms, but I get an access violation instead. What should I be checking for?
After a year, do you really have the exact same question? You didn’t provide any additional info (GPU, OpenCL driver, what you’ve tried, etc.). So it’s unclear why you think this post should generate anything useful.
I realize now that my post looks like a low-effort attempt at help with homework – I will do better.
I do in fact have the same question from a year ago. The previous thread was closed after nobody felt like responding, so thank you for the feedback. I read all of the posts you linked before my original post and decided the circumstances were different enough that I would start over.
Here is what I know: I am running Windows 10 on a Dell Precision 3541 laptop. The Device Manager shows 3 display adapters:
Intel(R) UHD Graphics 630 - driver version 126.96.36.1998 dated 1/20/22
NVIDIA Quadro P620 - driver version 188.8.131.524 dated 6/22/22
Plugable UD-3900 - (DisplyLink) driver version 10.1.2875.0 dated 8/11/21
Under Driver Details for the first two I see C:\WINDOWS\system32\OpenCL.dll in the list.
I honestly don’t know what it means for a graphics driver to be installed improperly. Your first linked thread resolved a known issue (in 2016) with a reinstall of the driver and my drivers appear to be much newer than that.
I am using the NVIDIA SDK, but the fact that there are other things besides the NVIDIA device on this list shouldn’t break anything, right? I believe the NVIDIA device is working - I have been able to point other (custom) software to it and see it listed under “GPU engine” in the Task Manager.
This is the university’s computer and if I need to ask them to do something to it, I just want to be as specific as possible.
Well, that last linked issue indicated that they needed to go forceably cleanup some stuff left over by the Intel graphics driver. No clue if that’s needed nowadays. I have no experience with OpenCL on a laptop.
There’s also the fun of dualing GPUs, which one you’re running on (“preferred graphics processor” = “High-performance NVIDIA processor”), and whether the Intel owns the display+scan-out and just farms out offscreen rendering to the NVIDIA.
Here’s another similar clGetPlatformIDs() crash on dual Intel/NVIDIA GPU system that mentions a few solutions, including: