我有一台笔记本电脑,搭载AMD Ryzen 5 2500u处理器(带有集成的Radeon Vega 8移动GPU),并使用Ubuntu 18.04.2。我想在CPU和GPU上使用C++进行一些OpenCL计算。我的问题是我不确定如何让OpenCL识别CPU。
我已经从AMD网站安装了amdgpu-pro和AMD APP SDK 3.0。 运行clinfo后,我得到以下输出:
第一个平台“Clover”带有设备“AMD RAVEN(DRM 3.26.0、4.18.0-16-generic、LLVM 7.0.0)”,设备类型为“GPU”,第二个平台带有设备“gfx902”,也似乎是我的系统的GPU。Number of platforms 2
Platform Name Clover
Platform Vendor Mesa
Platform Version OpenCL 1.1 Mesa 18.2.8
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd
Platform Extensions function suffix MESA
Platform Name AMD Accelerated
Parallel Processing Platform Vendor Advanced Micro Devices, Inc.
Platform Version OpenCL 2.1 AMD-APP (2671.3)
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd cl_amd_event_callback cl_amd_offline_devices
Platform Host timer resolution 1ns
Platform Extensions function suffix AMD
Platform Name Clover
Number of devices 1
Device Name AMD RAVEN (DRM 3.26.0, 4.18.0-16-generic, LLVM 7.0.0)
Device Vendor AMD
Device Vendor ID 0x1002
Device Version OpenCL 1.1 Mesa 18.2.8
Driver Version 18.2.8
Device OpenCL C Version OpenCL C 1.1
Device Type GPU
Device Profile FULL_PROFILE
Device Available Yes
Compiler Available Yes
Max compute units 8
Max clock frequency 1100MHz
Max work item dimensions 3
Max work item sizes 256x256x256
Max work group size 256
Preferred work group size multiple 64
Preferred / native vector sizes
char 16 / 16
short 8 / 8
int 4 / 4
long 2 / 2
half 8 / 8 (cl_khr_fp16) float 4 / 4
double 2 / 2 (cl_khr_fp64)Half-precision Floating-point support (cl_khr_fp16)
...
Platform Name AMD Accelerated Parallel Processing
Number of devices 1
Device Name gfx902
Device Vendor Advanced Micro Devices, Inc.
Device Vendor ID 0x1002
Device Version OpenCL 1.2 AMD-APP (2671.3)
Driver Version 2671.3 (PAL,HSAIL)
Device OpenCL C Version OpenCL C 1.2
Device Type GPU
Device Board Name (AMD) Unknown AMD GPU
Device Topology (AMD) PCI-E, 05:00.0
Device Profile FULL_PROFILE
.......
NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) No platform
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) No platform
clCreateContext(NULL, ...) [default] No platform
clCreateContext(NULL, ...) [other] Success [MESA]
clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT) Success (1)
Platform Name Clover Device Name AMD RAVEN (DRM 3.26.0, 4.18.0-16-generic, LLVM 7.0.0)
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) Success (1)
Platform Name Clover Device Name AMD RAVEN (DRM 3.26.0, 4.18.0-16-generic, LLVM 7.0.0)
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) Success (1)
Platform Name Clover Device Name AMD RAVEN (DRM 3.26.0, 4.18.0-16-generic, LLVM 7.0.0)
所以我的问题是:我需要安装什么才能让OpenCL也识别出我的系统CPU?
谢谢帮忙!