Need an OpenCL library that works under QEMU - opencl

I am unsure to put it up, but I need an OpenCL library that can actually work under QEMU.
I have tried NVidia, and AMD but none of them seem to function there.
Does anyone have any idea?

Use the Intel's or AMD's libs, they both run on the CPU.

Related

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

How to let OpenCl see intel and nvidia devices?

I wonder how we can have OpenCl "seeing" my K20. Xeon, and Xeon Phi at the same time?
Especially I'm confused about the use of two libraries here (from NVidia and Intel).
How to do it, if possible at all?
The OpenCL Installable Client Driver (ICD) takes care of this for you. It is the same regardless of whose implementation you have installed, and exposes all implementations as separate OpenCL "Platforms".
When you call clGetPlatformIDs it will tell you how many platforms you have installed. There could be one for AMD, one for NVIDIA, and one for Intel, for example.
Then within each platform you call clGetDeviceIDs which will return the number of devices within that platform. On your NVIDIA platform you'll find your K20, and within your Intel platform you'll find your Xeon CPU and Xeon Phi co-processor.
If you build or download the clInfo utility you'll see a nice dump of all the installed platforms and devices and the capabilities of each.
The problem is solved.
Looking at the key directory:
/etc/OpenCL/vendors/*.icd
I noticed that for Nvidia the library in used was a link which was duplicated in difference places and pointing to two different releases.
I just replace the former one by the most recent one, the one I've installed recently, and here we go.
Opencl did not know which one to use I guess.
It's like the installation location has changed between the two nividia versions.
When I was supposed to have removed it before reinstalling that was actually not true.
Thank you all for your hell.

How to debug OpenCL on Nvidia GPUs?

Is there any way to debug OpenCL kernels on an Nvidia GPU, i.e. set breakpoints and inspect variables? My understanding is that Nvidia's tool does not allow OpenCL debugging, and AMD's and Intel's only allow it on their own devices.
gDEBugger might help you somewhat (never used it though), but other than that there isn't any tool that I know of that can set breakpoints or inspect variables inside a kernel. Perhaps try to save intermediate outputs from your kernel if it is a long kernel. Sorry I can't give you a magic solution, debugging OpenCL is just hard.

How to handle OpenCL code on unsupported hardware in a C++ app

I've been doing some research in to OpenCL, and the possibility of using it on a project. The question I have is, is there a way to run OpenCL code on a CPU that is unsupported by the OpenCL SDKs in a C++ application. I know Java has Aparapi, however I'm wondering how to run OpenCL code in a C++ application without hardware that is supported by the SDKs. There is some code I would like to write in OpenCL kernels to take advantage of the OpenCL parallelism where available, however I'm unsure if I wouldn't be able to run it on older hardware (still X86, but not recent hardware). Could anyone explain to me how this can be done, or if it is even a problem at all to run OpenCL code on older systems?
Thanks,
Peter
I would say best way to approach this is to check if the device supports OpenCL via OpenCL API calls such as clPlatformIDs then once you figure it isn't a OpenCL device then run the required code as normal C/C++ function otherwise run it using openCL kernel. But for portability you need to write the program logic twice once in .cl file and once as normal c/c++ method/function.

Opencl FFT libraries? Anything new or under the radar out there?

I googled this topic and didn't find anything new. I am aware of Nvidia's FFT implementation which is great, but for CUDA only. AMD just released their implementation, but it doesn't work on Nvidia cards. Apple has an older and slower implementation. Are there any other good FFT libraries out there? It would be nice if there was an implementation that was meant to work on Nvidia and AMD cards and other possible platforms and is being actively maintained.
The AMD clAmdFft library should work on NVidia GPUs.
I was involved in the development and I know that was the intention. The code was written to the OpenCL standard and doesn't use any proprietary tricks. Of course, AMD didn't do QA testing on NVidia hardware. It could be that NVidia's OpenCL implementation isn't quite 100% compliant to the standard yet. Or it could be something about your particular video card.
Please post more details here as to exacly what is happening. You should also post that information in the AMD developer forums as a bug.
AMD recently released an OpenCL SDK for their CPUs as wel as GPUs. Included in it are FFT and BLAS libraries. You can go to the bottom of the page to find out about the supported devices.
But I am not really sure about the performance.
Not yet - but there is a project to port the GSL (Gnu Scientific Library) to opencl
http://gsl-cl.sourceforge.net/
I know Apple has released an OpenCL FFT package, but I don't know much about it. I've heard that they make the source available.

Resources