In my application, I need to run the same program in servers with and without GPU installed, and that’s the reason I choose OpenCL since it’s cross-platform. However, I found that on a Nvidia platform, seems a GPU card is mandatory. Is that right?
My code is:
ciErr1 = clGetDeviceIDs(cpPlatform, CL_DEVICE_TYPE_CPU, 1, &cdDevice, NULL);
shrLog("clGetDeviceIDs...\n");
if (ciErr1 != CL_SUCCESS)
{
shrLog("Error in clGetDeviceIDs, Line %u in file %s !!!\n\n", __LINE__, __FILE__);
Cleanup(EXIT_FAILURE);
}
and the error shows:
clGetDeviceIDs…
Error in clGetDeviceIDs, Line 118 in file vectorAdd.cpp !!!
That is correct, NVIDIAs OpenCL implementation requires a NVIDIA graphics card. I should however be OK to install both NVIDIAs GPU version and AMDs OpenCL which has support for CPUs simultaneously and at runtime choose whatever device are best suited for the task at hand.
That is correct, NVIDIAs OpenCL implementation requires a NVIDIA graphics card. I should however be OK to install both NVIDIAs GPU version and AMDs OpenCL which has support for CPUs simultaneously and at runtime choose whatever device are best suited for the task at hand.
If you install both nvidia gpu programming SDK and AMD Stream OpenCL SDK, wouldn’t the application in run time will use only ONE of them?
if not, how can you avoid it?
did you think about dynamicly loading both dlls, and looking for the same functions in the dlls as function pointers? such thing might work…
probably the only functions we REALLY care about are compiling the kernels and data transfers…
Any comments/ideas?
else
I would think nvidia implementation for compiling the OpenCL kernel when the kernel should run on the GPU is preferable, while kernels that should run on the
CPU can’t be compiled with nvidia openCL implementation.
If you install both nvidia gpu programming SDK and AMD Stream OpenCL SDK, wouldn’t the application in run time will use only ONE of them?
if not, how can you avoid it?
did you think about dynamicly loading both dlls, and looking for the same functions in the dlls as function pointers? such thing might work…
probably the only functions we REALLY care about are compiling the kernels and data transfers…
Any comments/ideas?
else
I would think nvidia implementation for compiling the OpenCL kernel when the kernel should run on the GPU is preferable, while kernels that should run on the
CPU can’t be compiled with nvidia openCL implementation.
Yes, you can install both NVIDIA’s OpenCL and AMD Stream’s OpenCL implementations side by side. You can use both at the same time - but there’s a catch. You need to understand a Context and how it relates to memory, calculations, etc. A context wraps up the hardware, kernels, command queues, etc, and thus really pertains to one hardware platform/device. In my limited experience, creating multiple contexts has allowed both OpenCL DLLs to be used. You have to compile your programs for that context, and if you want to share memory, you’ll need to pass it back and forth between the host.
This comes down to implementation. NVIDIA compiles into PTX, I believe, which is their instruction set for their GPUs. AMD compiles into something else, but I can’t remember right now. Most all CPUs need x86.
I personally find having both platforms installed as being helpful for development. I find that the AMD driver is useful for compiling and debugging on at CPU, since you can use output functions, as well as having more verbose compiler information when I make an error coding (like stating a variable was not used, etc). It is then a trivial matter to use the NVIDIA dll and compile and test for that platform.
Disclaimer - I’m not a computer scientist - I’m an aerospace engineer. Forgive me for any errors that I might have made above.
Yes, you can install both NVIDIA’s OpenCL and AMD Stream’s OpenCL implementations side by side. You can use both at the same time - but there’s a catch. You need to understand a Context and how it relates to memory, calculations, etc. A context wraps up the hardware, kernels, command queues, etc, and thus really pertains to one hardware platform/device. In my limited experience, creating multiple contexts has allowed both OpenCL DLLs to be used. You have to compile your programs for that context, and if you want to share memory, you’ll need to pass it back and forth between the host.
This comes down to implementation. NVIDIA compiles into PTX, I believe, which is their instruction set for their GPUs. AMD compiles into something else, but I can’t remember right now. Most all CPUs need x86.
I personally find having both platforms installed as being helpful for development. I find that the AMD driver is useful for compiling and debugging on at CPU, since you can use output functions, as well as having more verbose compiler information when I make an error coding (like stating a variable was not used, etc). It is then a trivial matter to use the NVIDIA dll and compile and test for that platform.
Disclaimer - I’m not a computer scientist - I’m an aerospace engineer. Forgive me for any errors that I might have made above.