Is There A Way To Upgrade to OpenCL 2.0? - opencl

There is a feature in OpenCL 2.0 that I would like to use.
I dual boot Ubuntu and Mac OS (Graphics: GTX 670 + HD Graphics 4600). Is it possible to install OpenCL 2.0?
This may be a dumb question - from what I have read, it seems like 2.0-compatible drivers may not be written yet? And also possibly my hardware will not support the new spec?
Basically, when will OpenCL 2.0 be easy/available?

You mentioned you have an NVidia GTX 670; you should note that NVidia's drivers only support OpenCL 1.1, not 1.2.
NVidia have(*) refrained over the past several years from updating their drivers to support the newer OpenCL standard, even though the hardware obviously supports it and CUDA has all the relevant functionality... so don't expect 2.0 to happen so soon on your hardware.
(*) - Due to being Evilâ„¢.

There are no OpenCL 2.0 drivers yet. The specification just became final yesterday. I don't believe any public statements have been made yet about when drivers will become available, and for what hardware. You'll have to wait for whatever fun new feature you wanted. Better yet, let your favorite vendors know that you'd like them to support OpenCL 2.0!

There is some support for OpenCL in Clang 3.0 and from the LLVM organisation.
See the CLang 3.0 release notes
http://llvm.org/releases/3.0/docs/ClangReleaseNotes.html
Here's an LLVM presentation on OpenCL
http://llvm.org/devmtg/2009-10/OpenCLWithLLVM.pdf
Here's another Stackoveflow answer on Clang 3.0 for OpenCL
How to use clang to compile OpenCL to ptx code?
So there are some good folks working on an open source version of OpenCL that compiles to PTX for NVida cards. Not having used it and not being familiar with these efforts, I can't say if there are plans or when when they can get to the OpenCL 2.0 spec.

Related

Can an OpenCL .cl file compiled to SPIR-V be cross-compiled to Metal?

For context, I am researching upgrades into our OpenCL code at work as we are quite far behind current spec. The team I work in develops on all three of the major OSes and as far as I can tell Apple doesn't support past OpenCL 1.2 on any of their machines instead prompting you to learn and use Metal performance shaders.
I would like to update our code base to C++ for OpenCL which is based on OpenCL 2.0 or 3.0 depending on which version you use. C++ for OpenCL is fine on Windows and Linux as they have GPU drivers which support up to and past the 2.0 requirement, but Mac might have a problem with it without official support in the drivers. So I had the idea that if we could cross compile the CL kernels to Metal for the Mac users they would be able to run a Metal version of the code locally.
Has anyone got any solutions to this problem.

How do OpenCL platforms are listed for OpenCL-2.0 devices?

I need to implement a truly working platform version filter targeted to version 1.2 for my open-source project:
https://github.com/tugrul512bit/Cekirdekler
I don't have 150$ to buy an OpenCL2.0 capable graphics card for now so I'm working on a pure-1.2 version system and not sure about other (new)systems.
Question: How does a list of platforms looks like when there are only opencl 2.0 capable gpus and both 1.2(max) and 2.0(max) capable gpus exist in same system?
Lets assume I'm using this
clGetPlatformIDs()
to get a list. Should I suppose it gives only single version platforms per device or,
For example, a GTX-Titan XP(opencl 2.0 capable?) can list two platforms:
OpenCL 1.2
OpenCL 2.0
separately for same device? Or it just gives 2.0 version?
What about a GTX-TitanXP and a GT-640?
OpenCL 1.2 (TitanXP + GT-640)
OpenCL 2.0 (TitanXP)
or
OpenCL 2.0 (TitanXP)
OpenCL 1.2 (GT-640)
which one happens?
Can this change with drivers?
What about OpenCL version 2.3 GPUs? Do they seem as 2.0 in OpenCL API or correctly give 3 as minor version?
If anyone could share his/hers experience, I appreciate.
For now, project can take 1.2 or 2.0 versions (Intel drivers I installed have an experimental version 2.1 with bugs so I filter-out with minor version checking, I'm not sure if Nvidia or Amd can do similar or opposite things in OpenCL-2.x capable cards). I can also filter for platform names "experimental"/"beta" to elliminate such platforms but I'm not sure if there are multiple versions for same GPUs.
I assume 2.0 devices have backwards compatilibity for 1.2 but do I need anything extra to enable 1.2 spec? For now I'm not doing anything extra for 1.2 devices. Maybe 2.0 needs some?
Each platform returns its own version number independently of the others. You can have a mix, for example a GPU at 1.2 and a CPU driver at 2.0.
If you make only OpenCL 1.2 API calls you can use either. If you make OpenCL 2.0 API calls you can only use 2.0 or higher platforms.
Likewise, devices within a platform can return their own version numbers, although I don't think they can be larger than their parent platform number. An example of this is an older GPU, which might only be OpenCL 1.1 even though the platform is 1.2.
Separate from this is the version of OpenCL kernel language each device supports. For backwards compatibility if you don't pass compile options you are getting OpenCL C 1.x. If you are on a 2.x device you can pass an option string when compiling your kernel to get new language features.

OpenCL 2.0 on nVIDIA Graphics cards

I want to use OpenCL 2.0 because it benefit from very nice features like Creating Sub Devices, or Shared Virtual Memory but my OpenCL header files which are coming out with nvidia cuda does not have the opencl 2.0 functions. Is there any way to use OpenCL 2.0 on my nvidia gpus?
In the 378.66 drivers NVIDIA claims limited support of OpenCL 2.0 for evaluation purposes. Look at page 10 of release notes http://us.download.nvidia.com/Windows/378.66/378.66-win10-win8-win7-desktop-release-notes.pdf
Unfortunately not - NVIDIA does not currently support OpenCL 2.0, and they have not yet given any timeframe for doing so.

Hardware supporting openCl 2.0?

Is there any hardware supporting openCL 2.0? If yes then please tell me company of the hardware,name of the product and if possible specification of that hardware). Thanks in Advance.
As of a few days now, Intel's HD Graphics 5300 in the new Core M processors do support OpenCL 2.0. They also have a CPU driver for all Intel processors, what I believe should also run on AMD processors.
No desktop versions of these processors are available yet, Acer, ASUS, Dell, HP, and Lenovo announced laptops and tablets based on them.
Intel SDK for OpenCL
Specifications of Intel Core M processors
(update October 2014)
We now have conformant OpenCL 2.0 implementations available from both Intel and AMD. The Khronos conformant OpenCL products page shows that AMD has quite a few GPUs that can run OpenCL 2.0. It's not clear exactly which devices Intel support OpenCL 2.0 on at the moment, although their Core M processors are explicitly called out on their OpenCL page.
(original answer May 2014)
At present, there are no conformant implementations of OpenCL 2.0 available.
In terms of hardware support, AMD have stated that some of their latest GPUs have the capabilities for OpenCL 2.0, and I would expect that most (if not all) modern CPUs have too (Xeon Phi likely does as well). NVIDIA's latest GPUs are probably also compliant, since they have CUDA equivalents of nested parallelism and SVM.
So, we are just waiting for the actual implementations (i.e. drivers) to appear. At IWOCL'14 last week it was mentioned that the conformance package for OpenCL 2.0 was only just finalised recently, so we can expect to see these implementations start to appear in the coming months.
In the meantime, AMD have preliminary support for some OpenCL 2.0 already available in their latest beta driver.

Check OpenCL version compatibilty correctly?

My application is OpenCL 1.1 compatiable and I want to check whether each of the device has drivers for that version. There are 2 ways for this:
clGetDeviceInfo() ->CL_DEVICE_VERSION
clGetPlatformInfo() ->CL_PLATFORM_VERSION
I have following doubts:
I do not understand why method 1 is provided as method 2 seems the
correct way to me?
Is it possible that the version given by the platform will not
match with the version given by a device from the same platform?
What is clGetDeviceInfo::CL_DRIVER_VERSION for?
From all these options which one should I use to check if a device
can run my OpenCL 1.1 code?
There are some features in OpenCL that have hardware requirements. This means that even if a particular vendor's OpenCL implementation (the platform) supports an OpenCL version, the device might not. So, it is entirely possible for the versions returned from the CL_DEVICE_VERSION and CL_PLATFORM_VERSION queries to differ.
This will probably start to happen more frequently when OpenCL 2.0 implementations start appearing, as there is plenty of hardware on the market that doesn't have the necessary support for OpenCL 2.0 features. Imagine a system that has two devices from Vendor X: a new Device A that can run OpenCL 2.0, and a much older Device B that can't. In this instance, the platform version may be OpenCL 2.0, but the device version could be OpenCL 2.0 for Device A and OpenCL 1.2 for Device B.
The CL_DRIVER_VERSION is for getting a vendor specific version number for the implementation. This number could using any version numbering system that the vendor uses to keep track of different software releases, and is completely independent from OpenCL version numbers (although some vendors may well include the OpenCL version here too).
So, in order to be sure that both the device and platform support your required OpenCL version, you should just need to check CL_DEVICE_VERSION.

Resources