java - CPU 未列为使用 Windows 的设备

标签 java windows opencl lwjgl

我的目的是对 CPU 和 GPU 之间的差异进行基准测试。 问题是,我只能检索我的 GPU,我的 CPU 没有显示

该程序在 OSX 上生成正确输出。其中列出了 CPU 和 GPU:

public static void displayInfo() {

    for (int platformIndex = 0; platformIndex < CLPlatform.getPlatforms().size(); platformIndex++) {
        CLPlatform platform = CLPlatform.getPlatforms().get(platformIndex);
        
        System.out.println("Platform #" + platformIndex + ":" + platform.getInfoString(CL_PLATFORM_NAME));

        List<CLDevice> devices = platform.getDevices(CL_DEVICE_TYPE_ALL);
        for (int deviceIndex = 0; deviceIndex < devices.size(); deviceIndex++) {
            CLDevice device = devices.get(deviceIndex);
            System.out.printf(Locale.ENGLISH, "Device #%d(%s):%s\n",
                    deviceIndex,
                    UtilCL.getDeviceType(device.getInfoInt(CL_DEVICE_TYPE)),
                    device.getInfoString(CL_DEVICE_NAME));
        }
    }
}

我的输出:

Platform #0:NVIDIA CUDA

Device #0(GPU):GeForce GTX 560 Ti

Device #1(GPU):GeForce GTX 560 Ti

我的电脑:

  • 英特尔 i5-2500K
  • Windows 8.1 专业版 (x64)
  • 2x GeForce GTX 560 Ti

我正在使用lwjgl版本2.8.4

为什么我无法检索我的 CPU?

最佳答案

(重新发布评论中的答案)

OS X 的独特之处在于它预装了 OpenCL CPU 驱动程序,因此 OpenCL 可以“开箱即用”地工作。在 Windows 和 Linux 上,您需要为您的 CPU 安装 OpenCL 运行时/驱动程序。对于 Intel CPU,您可以在这里找到它们:

https://software.intel.com/en-us/articles/opencl-drivers

关于java - CPU 未列为使用 Windows 的设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29761149/

相关文章:

windows - 支持 IAccessible 接口(interface)以在文本编辑器中移动插入符号的正确解决方案是什么?

cuda - GPU 与 FPGA 的 OpenCL

c - 包含 header OpenCL(32 位与 64 位)

java - Java 中的图像作为 Int 数组

java - java中ArrayList的lastIndexOf运行时间

java - 需要在字段中输入值,检查结果,然后在 Selenium Java 中添加一个字符

java - 无法加载要通过键盘移动的图像

windows - 为什么 Windows 上的 git diff 会警告 "terminal is not fully functional"?

Windows CMD 使用转义序列写入文件

c++ - clGetDeviceInfo 和 clGetPlatformInfo 在 OpenCL 中失败,错误代码为 -30 (CL_INVALID_VALUE)