The State of OpenCL & the First End-User OpenCL Drivers
by Ryan Smith on October 6, 2009 12:00 AM EST- Posted in
- Ryan's Ramblings
Last week NVIDIA released their first set of end-user OpenCL drivers. Previously OpenCL drivers had only been available for developers on the NVIDIA side of things, and this continues to be the case on the AMD side of things. With NVIDIA’s driver release, the launch of AMD’s 5800 series, and some recent developments with OpenCL, this is a good time to recap the current state of OpenCL, and what has changed since our OpenCL introductory article from last year.
A CPU & GPU Framework
Although we commonly talk about OpenCL alongside GPUs, it’s technically a hardware agnostic parallel programming framework. Any device implementing OpenCL should be cable of running any OpenCL kernel, so long as the developers take in to account querying the host device ahead of time as to not spawn too many threads at once. And while GPUs (being the parallel beasts that they are) are the primary focus, OpenCL is also intended for use on CPUs and more exotic processors such as the Cell BE and DSPs.
What this means is that when it comes to discussing the use of OpenCL on computers, we have two things to focus on. Not only is there the use of OpenCL on the GPU, but there’s the use of OpenCL on CPUs. If Khronos has their way, then OpenCL will be a commonly used framework for CPUs both to take better advantage of multi-core CPUs (8 threaded i7 anyone?) and as a fallback mechanism for when OpenCL isn’t available on a GPU.
This also makes things tricky when it comes to who is responsible for what. AMD for example, in making both GPUs and CPUs, is writing drivers for both. They are currently sampling their CPU driver as part of their latest Stream SDK (even if it is a GPU programming SDK), and their entire CPU+GPU driver set has been submitted to the Khronos group for certification.
NVIDIA on the other hand is not a CPU manufacturer (Tegra aside), so they are only responsible for having a GPU OpenCL driver, which is what they have been giving to developers for months. They have submitted it to Khronos and it has been certified, and as we mentioned they have released it to the public as of last week. NVIDIA is not responsible for a CPU driver, and as such they are reliant on AMD and Intel for OpenCL CPU drivers. AMD likes to pick at NVIDIA for this, but ultimately it’s not going to matter once everyone finally gets up to speed.
Intel thus far is the laggard; they do not have an OpenCL implementation in any kind of public testing, for either CPUs or GPUs. For AMD GPU users this won’t be an issue, since AMD’s CPU driver will work on Intel CPUs as well. For NVIDIA GPU users with Intel CPUs, they'll be waiting on Intel for a CPU driver. Do note however that a CPU driver isn't required to use OpenCL on a GPU, and indeed we expect the first significant OpenCL applications to be intended to run solely on GPUs anyhow. So it's not a bad situation for NVIDIA, it's just one that needs to be solved sooner than later.
OpenCL ICD: Coming Soon
Unfortunately matters are made particularly complex by the fact that on Windows and Linux, writing an OpenCL program right now requires linking against a vendor-specific OpenCL driver. The code itself is still cross-platform/cross-device, but in terms of compiling and linking OpenCL has not been fully abstracted. It’s not yet at the point where it’s possible to write and run a single Windows/Linux program that will work with any OpenCL device. It would be the equivalent of requiring an OpenGL game (e.g. Quake) to have a different binary for each GPU vendor’s drivers.
The solution to this problem is that OpenCL needs an Installable Client Driver (ICD), just like OpenGL does. With an ICD developers can link against that, and it will handle the duties of passing things off to vendor-specific drivers. However an ICD isn’t ready yet, and in fact we don’t know when it will be ready. NVIDIA - who chairs the OpenCL working group - tells us that the WG is “driving to get an ICD implementation released as quickly as possible”, but with no timetable attached to that. The effort right now appears to be on getting more OpenCL 1.0 implementations certified (NV is certified, AMD is in progress), with an ICD to follow.
Meanwhile Apple, in the traditional Apple manner, has simply done a runaround on the whole issue. When it comes to drivers they shipped Snow Leopard with their own OpenCL CPU driver, and they have GPU drivers for both AMD and NVIDIA cards. Their OpenCL framework doesn’t have an ICD per-say, but it has features that allow developers to query for devices and use any they like. It effectively accomplishes the same thing, but it’s only of use when writing programs against Apple’s framework. But to Apple’s credit, as of this moment they currently have the only complete OpenCL platform, offering CPU+GPU development and execution with a full degree of abstraction.
What GPUs Will Support OpenCL
One final matter is what GPUs will support OpenCL. While OpenCL is based around the hardware aspects of DirectX10-class hardware, being DX10 compliant isn’t enough. Even among NVIDIA and AMD, there will be some DX10 hardware that won’t support OpenCL.
NVIDIA: Anything that runs CUDA will run OpenCL. In practice, this means anything in the 8-series or later that has 256MB or more of VRAM. NVIDIA has a full list here.
AMD: AMD will only be supporting OpenCL on the 4000 series and later. Presumably there was some feature in the OpenCL 1.0 specification that AMD didn’t implement until the 4000 series, which NVIDIA had since the launch of the 8-series. Given that AMD is giving Brook+ the heave-ho in favor of OpenCL, this will mean that there’s going to continue to be a limited selection of GPGPU applications that work on these cards as compared to the 4000 series and later.
End-User Drivers
Finally to wrap this up, we have the catalyst of this story: drivers. As we previously mentioned, NVIDIA released their OpenCL-enabled 190.89 drivers to the public last week, which we’re happy to see even if the applications themselves aren’t quite ready. This driver release was a special release outside of NVIDIA’s mainline driver releases however, and as such they’re already out of date. NVIDIA released their 191.07 WHQL-certified driver set yesterday, and these drivers don’t include OpenCL support. So while NVIDIA is shipping an OpenCL driver for both developers and end-users, it’s going to be a bit longer until it shows up in a regular release.
AMD meanwhile is still in a developer-only beta, which makes sense given that they’re still waiting on certification. The estimates we’ve heard is that the process takes a month, so with AMD having submitted their drivers early last month, they should be certified soon if everything went well.
67 Comments
View All Comments
Ryan Smith - Wednesday, October 7, 2009 - link
Yes, I am sure about the binary dependencies.Scali - Wednesday, October 7, 2009 - link
Care to elaborate then? As I say, if I just place a different OpenCL.dll into the directory, the same application can run on another vendor's hardware.Hence no binary dependency. You don't need to recompile the application.
So what are you talking about, if you are so sure?
Scali - Wednesday, October 7, 2009 - link
Ah, I see the problem.For some reason AMD used cdecl exported names, they now all have leading underscores. nVidia uses stdcall, which is the default in Windows, and also used in OpenGL32.dll under Windows.
I think AMD made a snafu there in their SDK.
tweakoz - Wednesday, October 7, 2009 - link
IIIIIII CCCCCCC DDDD !I C D D !
I C D D !
I C D D !
I C D D !
I C D D
IIIIIII CCCCCCC DDDD !
;>
Scali - Wednesday, October 7, 2009 - link
As I already said, an ICD isn't going to help AMD here. Either way, they have to recompile their code to use stdcall.Besides, for most people an ICD isn't that important. As long as they have an OpenCL for their videocard, which would work, it'd be fine. And that OpenCL dll would just be automatically installed with the videocard drivers.
Only people who would specifically want to run OpenCL on their CPU, or who have more than one brand of videocard in their machine, would benefit from an ICD. That's not the issue here. The issue here is that there's no way you can get nVidia's and AMD's libraries to play nice. One of them needs to recompile, and I think it's going to be AMD, since you will want OpenCL to be consistent with OpenAL and OpenGL in calling convention.
tweakoz - Saturday, January 9, 2010 - link
>>Only people who would specifically want to run OpenCL on their CPU, or who have more than one brand of videocard in their machine, would benefit from an ICD. That's not the issue here.Um, that would be me. Both the CPU and multiple cards.
ICD.
mtm
tweakoz - Wednesday, October 7, 2009 - link
doh....;>
mfago - Tuesday, October 6, 2009 - link
Anyone have any experience with development tools for CUDA/OpenCL? The (Anandtech) Fermi article mentions Visual Studio integration is coming -- how about something similar on Linux? Any experience with the current NVidia OpenCL profiler, or know of something (perhaps $$$) that is even better?Thanks!
- Matt
bobvodka - Tuesday, October 6, 2009 - link
I would suspect that, iff everything goes well, we can expect OpenCL support in the next driver drop from AMD which is more than likely going to be earlyish this month (I would suspect at the latest just before the Win7 launch date).Scali - Wednesday, October 7, 2009 - link
I doubt that, really.I don't think Khronos will even have it tested by that time, they took more than a month on nVidia's drivers aswell. Which means that they'd be through the tests in late October (they were sent to Kronos on the 21st of September).
Also, nVidia kept the drivers in beta another 3 months, before making it a first public release, and they haven't put them in the official driver release yet (as the article says, 190.89 supports it, but the recently released 191.07 doesn't yet).
I would think that AMD will also keep the drivers in beta for a while, even if they do pass OpenCL-conformance testing. After all, that only proves that the OpenCL portion works, it doesn't prove that the drivers as a whole work. They'd still need to be tested for regular functionality and pass WHQL. They'd also have to be merged back into the main release tree, as they'll be a few months behind regular releases by this time (just like nVidia released a new driver a few days ago still without OpenCL).
So no, I don't expect OpenCL drivers this month, probably not even next month.