How do I test OpenCL on GPU when logged in remotely on Mac?
- by Christopher Bruns
My OpenCL program can find the GPU device when I am logged in at the console, but not when I am logged in remotely with ssh. Further, if I run the program as root in the ssh session, the program can find the GPU.
The computer is a Snow Leopard Mac with a GeForce 9400 GPU.
If I run the program (see below) from the console or as root, the output is as follows (notice the "GeForce 9400" line):
2 devices found
Device #0 name = GeForce 9400
Device #1 name = Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz
but if it is just me, over ssh, there is no GeForce 9400 entry:
1 devices found
Device #0 name = Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz
I would like to test my code on the GPU without having to be root. Is that possible? Simplified GPU finding program below:
#include <stdio.h>
#include <OpenCL/opencl.h>
int main(int argc, char** argv) {
char dname[500];
size_t namesize;
cl_device_id devices[10];
cl_uint num_devices;
int d;
clGetDeviceIDs(0, CL_DEVICE_TYPE_ALL, 10, devices, &num_devices);
printf("%d devices found\n", num_devices);
for (d = 0; d < num_devices; ++d) {
clGetDeviceInfo(devices[d], CL_DEVICE_NAME, 500, dname, &namesize);
printf("Device #%d name = %s\n", d, dname);
}
return 0;
}
EDIT: I found essentially the same question being asked on nvidia's forums. Unfortunately, the only answer was of the form "this is the wrong forum".