OpenCL with ARM NEON (without Mali GPU) available? - opencl

I working on customized SoC with ARM Cortex-A9.
It supports NEON, but do not has Mali GPU.
With system, can I use OpenCL with NEON?
I found OpenCL SDK for Mali at ARM website.
(http://malideveloper.arm.com/resources/sdks/mali-opencl-sdk/)
but there isn't any words support NEON.

ARM have previously announced OpenCL for NEON, but these were not directly available to the public, and the 'opencl-for-neon' link on that page now just redirects to the Mali developer page.
You could instead use pocl, an open source implementation of OpenCL that runs on many different platforms, include ARM CPUs with NEON.

There exist some third party research work on this topic
they created a framework for OpenCL to make use of NEON instructions
check here:
https://www.researchgate.net/publication/261176555_OpenCL_framework_for_ARM_processors_with_NEON_support

Related

OrangePi Lite2 OpenCL Driver

I have recently purchased OrangePi's Lite2 development board, with Allwinner H6 SOC, which includes Quad-Core A53 + T720 Mali GPU.
In the H6 SPEC, it clearly states that the GPU supports OpenCL 1.1 API, however, the Ubuntu (Desktop vesrion) image I've installed from OrangePi's site doesn't include the OpenCL driver and I cannot find it anywhere on the web.
Is it possible that although the GPU itself supports OpenCL (in terms of hardware) Allwinner never implemented the driver for it? Or am I supposed to somehow recompile the Linux kernel with the Mali drivers?
As stated in Arm Community:
In this instance the SoC (System on chip) for the OrangePi2 is by Allwinner. You will need to contact Allwinner and ask them if they are willing to provide Shenzhen Xunlong Software the binaries you need for the OrangePi2.
The respone I got from AllWinner was:
Sorry,we do not open the OpenCL driver platform.
Which I translated as "Good luck in your future endeavors"

Stop OpenCL support for a GPU

I have two GPUs installed on my machine. I am working with library which uses OpenCL acceleration that only support one GPU and it is not configurable. I can not tell it which one I want. It seems that this library for some reason chose one of my GPUs that I do not want.
How can I delete/stop/deactivate this GPU from being supported as an OpenCL device?
I want to do this so I get only one supported GPU and the library will be forced to use it.
Note: Any option that contains change or edit the library is available for me.
P.S. I am on Windows 10 with Intel processor and Intel GPU + NVidia GPU
On Windows the OpenCL ICD system uses Registry entries to find all of the installed OpenCL platforms.
Solution: Using RegEdit you can backup and then remove the entry for the GPU you do not want to use. The Registry location is HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors.
Reference: https://www.khronos.org/registry/cl/extensions/khr/cl_khr_icd.txt

Altera Arria V latest software for OpenCL

I recently bought a new Altera Arria V board 1. I am planning to use it to design a certain application using OpenCL.
Unfortunately, I didn't find so far the required software to get it work. I mean by that the Altera RTE for OpenCL and the required driver (aclsoc_drv.ko).
I would be grateful if you could help me how I can find the latest software!
Thank you all
You need to read the manual about how to install and what you need to install which you should be able to find here: Arria V SoC Development Kit and SoC Embedded Design Suite
OpenCL runtime environment and SDK you can find here: Altera SDK for OpenCL
Also Altera OpenCL guides will be helpful.
If I understand to your problem correctly, you are missing the required BSP and the base design to support OpenCL development for your Arria V board.
For this problem, please check with the board vendor (customer support) for the availability of the two items.
To be able to develop under Altera OpenCL framework, you need to load a basic design file on to the flash ROM / configuration device on the board. This is to provide some necessary IP support for the basic PCIe and memory access. It is usually provided with the BSP from the board vendor.
Along with the basic design file, drivers should be included as well for your host to recognise the OpenCL device.
Until you sort out the above missing parts, your OpenCL development environment should be up and running. Good luck!

OpenCL for custom systems on SoC prototyping board

Is it possible to run OpenCL on a system designed by a user on a SoC prototyping board? To be more specific, I have a ZedBoard (Xilinx Zynq) that has Dual ARM cores and a Programmable Logic (PL) Area. If I design a simple system of my own that has a video processing accelerator implemented in the logic area, an ARM core and an AXI interconnect, what do I have to do to provide OpenCL support for this simple system? (In this simple system, the ARM core could be the "Host" and the video processing accelerator could be the "device").
I am a student and I have only some basic knowledge about OpenCL. I have researched about my question and have only ended up confusing myself. What are the things that have to be done to provide OpenCL support for a SoC? I understand that this may be a big project, but I need a guideline where to start and how to proceed.
what do I have to do to provide OpenCL support for this simple system?
Implement a OpenCL platform that makes either use of your ARM CPU or the FPGA (or both). I'd say that is pretty much impossible for you; ARM would surely offer one for the CPU if it was easy (and they definitely have the financial means to employ capable engineers/computer scientists), and implementing accelerators on an FPGA requires in-depth knowledge of FPGA development, as well as compiler theory and experience in systems design. I don't want to sound mean, but you seem to have none of these three.
You asked where to get started; I recommend just writing a first accelerator that e.g. adds up a vector of numbers; as soon as you have that, you will have a clearer idea of your task.
If you want to have a look at a reference: The Ettus USRP E310 is a zynq-based SDR device. Ettus has a technology called RFNoC, which allows users to write their own blocks to push data through. Notice that this took quite a few engineers and quite some time to get started. Notice further that it's much easier than implementing something that converts OpenCL to FPGA implementations.
If you have access to the Xilinx tools: Vivado HLS 15.1 System Edition should compile OpenCL kernels. This will also be included in the SDAccel tool suite.
Source: UG973: Vivado Design Suite User Guide Release Notes, Installation,and Licensing
An alternative might be switching to Altera. They provide some good examples for the Altera Cyclone V SoC which is comparable to Xilinx Zynq devices (also includes ARM Cortex-A9) :
AlteraSDK for OpenCL
I am also a student and my current project is also going on a similar direction, i have successfully installed a version of opencl called POCL on the zedboard, it successfully detects the arm cpu of the zedboard. To install pocl, you need llvm and a horde of other things as well. but basic steps to get pocl up on the zedboard are given below:-
Installing pocl:
http://www.hosseinabady.com/install-pocl-opencl
running example:
http://www.hosseinabady.com/embedded-system-by-examples/opencl_embedded_system/opencl-vector-addition
Lots of dependency: can resolved easily
but LLVM make sure you install 3.4 version for pocl 0.9
Steps to install llvm
https://github.com/pacs-course/pacs/wiki/Instructions-to-install-clang-3.1-on-ubuntu-12.04.1-and-12.10
POCL 0.9 is successfully working for me, as you do the installation you will face many other missing dependencies like hwloc, mesa libraries, open gl/cl headers icd loaders i hope you can resolve them as its a very big list to put up in stack overflow.
In order to detect your fpga as an open cl device, thats not going to be a trivial thing to do, you can refer to this link question i posted on github
https://github.com/pocl/pocl/issues/285
and also a research paper published by hosseinbady found on the publications link on the pocl website
http://pocl.sourceforge.net/publications.html
hope this helps you
Try the ARM OpenCL SDK. The Zedboard has an ARM A9 CPU, this should have a NEON SIMD vector unit http://www.arm.com/products/processors/technologies/neon.php which can run OpenCL. See http://www.arm.com/products/multimedia/mali-technologies/opencl-for-neon.php.
The Zedboard isn't listed as an OpenCL conformant platform https://www.khronos.org/conformance/adopters/conformant-products#opencl.
So there is a chance the ARM driver will not work.
Good luck!
If still relevant, try this paper OpenCL on ZYNQ [PDF]
Also note that Zynq-7000 is listed on https://www.khronos.org/conformance/adopters/conformant-products#opencl ( OpenCL_1_0 ), hence the compatibility.

Intel OpenCL Vs. Khronos OpenCL

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.

Resources