I am new in OpenCL. I have an Dell XPS 1645 laptop which has ATI Mobility Radeon HD 4670 graphics card and a Intel CPU. I saw that AMD's software does not support OpenCL stuff for my graphics card but in Khronos website, my video card is seen as OpenCL supported. So, what do I have to do to start OpenCL programming? Also, can I use AMD's software which is for OpenCL?
It looks like you have a laptop with Windows 7, an Intel Core i7 CPU with 4 cores and hyper-threading?
Well OpenCL can run on CPU's as well as GPU's. With this model won't be able to access the GPU as an OpenCL device, but you can still use the CPU as an OpenCL device.
So download the OpenCL SDK from Intel or AMD, or both. Install it and try the examples.
You will have the change the calls to
clGetDeviceIds( .... )
so that the device type specified is always CL_DEVICE_TYPE_CPU
Related
I have two computers, one with a GTX 980 + Intel Core i7 4960X and the other one has a AMD Radeon HD 7850 + Pentium G860. I am getting device features with opencl's clGetDeviceInfo function. I am wondering why the Penitum G860 is supporting cl_khr_gl_sharing extension and Core i7-4960X is not supporting in OpenCL.
Is that something related to difference between AMD and nVIDIA graphic cards? or it is really the difference between cpus? Because definitely, Core i7-4960 is much much more powerful than Pentium G860.
Intel OpenCL Drivers are installed on both computers. For the nVIDIA system, I am using nvidia opencl 1.1 driver but for AMD one, I am using AMD APP SDK 3.0. Can be some difference due to that?
What is an example of a target platofrm in OpenCL? is it, for example, an OS like Windows, Android, Mac, or is it the actual chips in a device?
An OpenCL platform is essentially an OpenCL implementation. It is not related to the operating system (if any). It is commonly related to the hardware chip, but not necessarily. For example, the AMD platform also supports Intel CPUs. Another example is the Beignet project, an open-source OpenCL platform which runs on Intel hardware, or Pocl, which runs on ARM and x86.
Some examples of existing OpenCL SDKs/platforms (I don't have their full names at hand so I'll just list the vendor/SDK name):
Proprietary:
Intel® SDK for OpenCL™ Applications
AMD APP SDK
NVIDIA OpenCL
ARM Mali OpenCL SDK
Apple OpenCL
Qualcomm Adreno SDK
Imagination Technologies OpenCL on PowerVR
There are also implementations by IBM, Samsung, Altera, Vivante, Xilinx, MediaTek, STMicroelectronics...
Open Source:
Beignet
Portable Computing Language
This list is not exhaustive.
What is the difference between Intel, AMD and Khronos OpenCLs. I am totally new to OpenCL and want to start with it. I don't know which one is better to install on my operating system.
OpenCL is an "extension" to C and C++ languages that enables parallelization of software on your compute devices: CPU, GPU, etc.
OpenCL is defined by a standard (created by Khronos Group) and implemented by hardware vendors Intel, AMD, nVidia, etc.. So each OpenCL implementation requires a vendor specific OpenCL driver that will enable the usage of the vendor's hardware.
So to conclude, if you have an Intel based system, use the Intel OpenCL because only so you would be able to use all compute devices in your machine. The same goes if you have an AMD system. Also, take note that there is no Khronos OpenCL implementation.
Of course you can have a platform with OpenCL enabled devices from multiple vendors (e.g. Intel CPU+GPU and nVidia discrete card). In this case the OpenCL runtime contains a generic layer (a dynamic loaded library). This layer is an interface which calls the implementations provided in each device driver depending on the selected OpenCL platform.
OpenCL is a standard defined by Kronos. They distribute header files that you have to give to your compiler. They do not distribute binaries to link against. For that, you must get an ICD (Installable Client Driver), on Windows this is in the form of a DLL file. You will get it from installing one or more of...
Nvidia drivers (if you have an Nvidia GPU)
AMD drivers (if you have an AMD GPU or an AMD CPU)
Intel Drivers (if you have an Intel CPU, also some Intel CPU's have built in GPU's).
Do not worry about compiling against one vendor and it not working on another, OpenCL has been carefully designed to work around this. Compile against any version you have, it will work with any other version that is the same or newer, regardless of who made it.
Be Aware, the AMD OpenCL driver will operate as an OpenCL driver for Intel CPU's. If, for example, you have an AMD GPU and an Intel CPU, and have installed the Intel OpenCL driver and the AMD OpenCL driver, the AMD driver will report that it can provide both a GPU device and a CPU device (your CPU), and the Intel driver will report having a CPU device (also your CPU) and most likely also a GPU device (the GPU that is on the Intel CPU die, for example on an i7-3770, this will be a HD4000). If you blindly ask OpenCL for "All CPU's available" you will get the AMD drivers and the Intel drivers offering you the same CPU. Your code will not run very well in this case.
On Windows it is expected that you will download the header files yourself, and then either create a library from the DLL (MSVC), or link directly against the DLL (Mingw & Clang default behavior).
On Linux, you package manager will likely have a library to link against, consult your distributions documentation regarding this. On Ubuntu and Debian this command will work...
sudo apt-get install ocl-icd-opencl-dev
On Mac, there is nothing to install, and trying to install something will likely damage your system. Just install Xcode, and use the framework "OpenCL".
There are other platforms, for example Android. Some FPGA vendors offer OpenCL libraries. Consult your vendors documentation.
Khronos defines OpenCL standard. Each vendor/ open source will implement that standards.
Khronos defines set of conformance tests which need to pass if a vendor claims that his opencl implementation is as per standard.
I am quite new in the world of GPU Computing. So I would really like someone to explain me the very basics. I have to Intel chipsets with the following GPUs:
GMA4500
HD graphics
I am interested in running algebraic and bitwise functions with huge data sets, like transpose of an array or bitwise shift of the lines of an array, in a GPU. The goal is of course to gain more performance.
My main question is how can I program such on GPUs? In the past I have used CUDA to program on nVIDIA video card. I understand from previous topics that I can't use CUDA for an INTEL GPUs. Thanks in advance!!
Update 1
I found out that Intel supports OpenCL for HD graphics. More precisely the Intel SDK for OpenCL applications provides a comprehensive development environment for OpenCL application on Intel® platforms including compatible drivers, code samples, development tools, such as the code builder, optimization guide, and support for optimization tools.
The SDK supports OpenCL 1.2 on 3rd and 4th generation Intel® Core™ processors with Intel® HD Graphics and Intel® Iris™ Graphics Family, Intel® Atom™ Processors with Intel HD Graphics, Intel® Xeon® processors, and Intel® Xeon Phi™ coprocessors.
OpenCL is the standard, cross-vendor API for GPGPU programming, roughly analogous to nVidia's proprietary CUDA.
I have a Samsung r60+ laptop with an AMD Mobility Radeon x2300.
Can I use it for OpenCL development?
I have installed the latest AMD SDK, but I only see the CPU compute device.
I am using Linux, but I am able to use Windows if necessary.
I do not think that AMD currently supports OpenCL for the mobility x2300. This source shows all the OpenCL devices that are supported by AMD OpenCL.
You could always write code for your CPU now, and then use the same kernel to operate on the GPU, when you get a supported device. But note that you probably won't get optimal performance on the GPU at first.