在Mac上远程登录时,如何在GPU上测试OpenCL?

Chr*_*uns 10 macos opencl gpu-programming

当我在控制台登录时,我的OpenCL程序可以找到GPU设备,但是当我使用ssh远程登录时却找不到.此外,如果我在ssh会话中以root身份运行程序,程序可以找到GPU.

这款电脑是配备GeForce 9400 GPU的Snow Leopard Mac.

如果我从控制台或以root身份运行程序(见下文),输出如下(注意"GeForce 9400"行):

2 devices found
Device #0 name = GeForce 9400
Device #1 name = Intel(R) Core(TM)2 Duo CPU     P8700  @ 2.53GHz
Run Code Online (Sandbox Code Playgroud)

但如果只是我,在ssh上,没有GeForce 9400条目:

1 devices found
Device #0 name = Intel(R) Core(TM)2 Duo CPU     P8700  @ 2.53GHz
Run Code Online (Sandbox Code Playgroud)

我想在GPU上测试我的代码,而不必是root.那可能吗?简化的GPU查找程序如下:

#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;
}
Run Code Online (Sandbox Code Playgroud)

编辑:我在nvidia的论坛上发现了基本相同的问题.不幸的是,唯一的答案是"这是错误的论坛".

Chr*_*uns 2

根据此论坛帖子,在 Windows 上,似乎无法远程访问 GPU 。

这篇文章是关于 Windows 而不是 Mac,因此没有直接解决这个问题。由于尚未有人提供任何答案,因此这是我迄今为止找到的最相关的信息。