use*_*757 1 linux virtual-machine opencl ubuntu-14.04
PC 配置:AMD 双核 E-350 1.6Ghz AMD 6310 高清显卡
我在 Windows 8 之上的 VMware Player 上运行 Ubuntu 14.04,并试图弄清楚我是否可以在 ubunutu 上运行 OpenCL,即使用 VM。
我正在阅读一本关于如何安装 OpenCL 的手册,第一步给出了这个输出。有人可以看到输出并告诉我应该做什么吗?我可以在 VM 上运行 OpenCL 吗?
1)首先,我们需要检查我们的系统配置,以确定是否可以在我们的机器中安装 OpenCL。我们可以在终端上运行“Hardinfo”命令来获取系统配置的完整摘要。如果我们的系统中没有安装 Hardinfo 命令,那么我们可以通过在终端上运行以下命令来轻松安装它: sudo apt-get install hardinfo 2)如果我们的系统可以支持 OpenCL 那么我们可以进入 OpenCL 的实际安装. 3) 从英特尔网站下载面向 OpenCL 应用程序的英特尔 SDK 。.....
varun@varun-virtual-machine:/$ hardinfo
Run Code Online (Sandbox Code Playgroud)
当前未安装程序“hardinfo”。您可以通过键入以下内容进行安装:sudo apt-get install hardinfo
varun@varun-virtual-machine:/$ sudo apt-get install hardinfo
Reading package lists... Done
Building dependency tree
Reading state information... Done
Run Code Online (Sandbox Code Playgroud)
您可能想要运行“ apt-get -f install
”来更正这些:
以下软件包具有未满足的依赖项:
fglrx : Depends: fglrx-core but it is not installable
Recommends: fglrx-amdcccle but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Run Code Online (Sandbox Code Playgroud)
从 Ubuntu 18.04 开始,要获得在仅 CPU 环境(如虚拟机)上运行的 OpenCL 版本,您需要做的就是:
sudo apt-get install libpocl2
Run Code Online (Sandbox Code Playgroud)
然后clinfo
会告诉你,例如:
Number of platforms 1
Platform Name Portable Computing Language
Platform Vendor The pocl project
Platform Version OpenCL 1.2 pocl 1.4, None+Asserts, LLVM 9.0.1, RELOC, SLEEF, DISTRO, POCL_DEBUG
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd
Platform Extensions function suffix POCL
Platform Name Portable Computing Language
Number of devices 1
Device Name pthread-Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Device Vendor GenuineIntel
Device Vendor ID 0x6c636f70
Device Version OpenCL 1.2 pocl HSTR: pthread-x86_64-pc-linux-gnu-skylake
Driver Version 1.4
Device OpenCL C Version OpenCL C 1.2 pocl
Device Type CPU
Device Profile FULL_PROFILE
Device Available Yes
Compiler Available Yes
Linker Available Yes
Max compute units 8
Max clock frequency 2807MHz
Device Partition (core)
Max number of sub-devices 8
Supported partition types equally, by counts
Supported affinity domains (n/a)
Max work item dimensions 3
Max work item sizes 4096x4096x4096
Max work group size 4096
Preferred work group size multiple 8
Preferred / native vector sizes
char 16 / 16
short 16 / 16
int 8 / 8
long 4 / 4
half 0 / 0 (n/a)
float 8 / 8
double 4 / 4 (cl_khr_fp64)
Half-precision Floating-point support (n/a)
Single-precision Floating-point support (core)
Denormals Yes
Infinity and NANs Yes
Round to nearest Yes
Round to zero Yes
Round to infinity Yes
IEEE754-2008 fused multiply-add Yes
Support is emulated in software No
Correctly-rounded divide and sqrt operations Yes
Double-precision Floating-point support (cl_khr_fp64)
Denormals Yes
Infinity and NANs Yes
Round to nearest Yes
Round to zero Yes
Round to infinity Yes
IEEE754-2008 fused multiply-add Yes
Support is emulated in software No
Address bits 64, Little-Endian
Global memory size 24638332928 (22.95GiB)
Error Correction support No
Max memory allocation 8589934592 (8GiB)
Unified memory for Host and Device Yes
Minimum alignment for any data type 128 bytes
Alignment of base address 1024 bits (128 bytes)
Global Memory cache type Read/Write
Global Memory cache size 6291456 (6MiB)
Global Memory cache line size 64 bytes
Image support Yes
Max number of samplers per kernel 16
Max size for 1D images from buffer 536870912 pixels
Max 1D or 2D image array size 2048 images
Max 2D image size 16384x16384 pixels
Max 3D image size 2048x2048x2048 pixels
Max number of read image args 128
Max number of write image args 128
Local memory type Global
Local memory size 4194304 (4MiB)
Max number of constant args 8
Max constant buffer size 4194304 (4MiB)
Max size of kernel argument 1024
Queue properties
Out-of-order execution Yes
Profiling Yes
Prefer user sync for interop Yes
Profiling timer resolution 1ns
Execution capabilities
Run OpenCL kernels Yes
Run native kernels Yes
printf() buffer size 16777216 (16MiB)
Built-in kernels (n/a)
Device Extensions cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_3d_image_writes cl_khr_fp64 cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp64
NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) Portable Computing Language
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Success [POCL]
clCreateContext(NULL, ...) [default] Success [POCL]
clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT) Success (1)
Platform Name Portable Computing Language
Device Name pthread-Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) Success (1)
Platform Name Portable Computing Language
Device Name pthread-Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) No devices found in platform
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 Portable Computing Language
Device Name pthread-Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.11
ICD loader Profile OpenCL 2.1
Run Code Online (Sandbox Code Playgroud)
测试:
非常感谢PoCL 团队让这一切成为可能!
可以在虚拟机中运行 OpenCL,但您只能访问 CPU 设备。Intel SDK 不能工作,因为它有严格的硬件要求,但 AMD SDK 安装得很好。我在 Windows 8 + VirtualBox 下的 Ubuntu 14.04 VM 上使用 AMD-APP-SDK-v2.8-RC-lnx64 运行。您可以从这里获取 SDK:http : //developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/download-archive/