Is there a way to send a video as an argument to an OpenCL kernel, or can it only be sent frame by frame?
What is the correct approach for video processing over OpenCL kernel?
PS- I'm using NVidia GTX 1050Ti on Ubuntu 14.04
Related
I'm starting OpenCL. As I've understood, a platform is a vendor-specific OpenCL implementation, and a device is a processing unit that can be used by a platform.
I've made a simple C++ code that prints the platform name and for each of its devices prints the device name, and its output is
Platform 0: Intel(R) OpenCL HD Graphics
Device 0: Intel(R) Gen9 HD Graphics NEO
Platform 1: Intel(R) CPU Runtime for OpenCL(TM) Applications
Device 0: Intel(R) Core(TM) i5-6200U CPU # 2.3GHz
My question is, shouldn't I expect the two devices to be under the same platform? Given I have a laptop, and the GPU is integrated together with the processor. Also, will this then forbid me for assigning both GPU and CPU devices to the same context? (which I've read has some memory sharing advantages)
shouldn't I expect the two devices to be under the same platform
Only if the vendor provides a platform with drivers for both those devices. I'm not sure if Intel's "NEO" platform has also CPU driver, but i'm pretty sure the "CPU runtime" only has driver for the CPU, not the iGPU. You'll have to list the devices of each platform to find out.
will this then forbid me for assigning both GPU and CPU devices to the same context
You have to list the devices - if NEO has both devices then you can use that. But you can't have devices from different platforms in a single context.
I can view the Intel HD Graphics Command Queue with VTune, but I cannot the CPU Command Queue. Why? It is the expected behavior, to only capture GPU "events" but not those from the CPU that are independent of the GPU?
The same OpenCL program (a simple vector addition) running in the GPU shows the events (NDRange, etc) but in the CPU not (you only see clWrite,Read Buffer and clBuildProgram). Also, you cannot see any info in the region where CPU is working with OpenCL (clWaitForEvents).
CPU:
GPU:
I have two basic questions about getting started with GPGPU programming:
(1) If I do GPGPU on my Mac, will it affect the image on the monitor? How do I know the windowing system or other programs output is not competing for the GPU?
(2) Is there a way to try out AMD GPU programming somewhere without buying a high-end graphics card? The rental cloud places I have seen all use Nvidia. My computation would be logical integer (bit-twiddling) compute-bound, and I have read that AMD GPU is better for these applications.
1) It won't affect the image on the monitor. And to check if another process is using the GPU you'll need something like AMD System Monitor for mac (this application only works on Windows)
2) Any radeon HD 4xxx and above supports OpenCL (previous card might support this, but I'm not sure). This mean any new AMD card you can buy, including the cheapest ones support OpenCL.
The difference between the expensive cards and the cheap ones is the number of stream processors. For example
Radeon HD 4350: 80 stream processors
Radeon x290: 2560 stream processors
any one help i execute opencl kernel program for image processing and want to know the process faster when the kerenl execute on cpu or gpu
i using tool "GPU caps viewer" take picture for specification cpu and gpu and want to know the best for run opencl kernel code to the cpu or gpu . why??
the gpu info
and for cpu
amd info
intel
and i want to know why three option different for cpu (intel , amd) info
constant buffer amd 64KB intel 128KB
max sampler amd 16 intel 480
opencl extention amd 16 intel 14
work group size amd 16 intel 14
any help
thanks
My laptop had
- one CPU core i5: Intel(R) Core(TM) i5-3210M CPU # 2.50GHz
- one Graphic card: Intel(R) HD Graphics 4000
- one Nvidia card ( external card ): GeForce GT 630M
But When I tried to use JavaCL.createBestContext(), it looks like just use one card Intel HD Graphics. So I tried to combine 3 : CPU and 2 GPUs by using:
List<CLDevice> devices = new ArrayList<CLDevice>();
// try to list all platform and devices
for(CLPlatform platform : JavaCL.listPlatforms()) {
//System.out.println(platform.getName());
for (CLDevice device : platform.listAllDevices(true)) {
System.out.println(device.getName().trim());
devices.add(device);
}
}
CLDevice device1 = (CLDevice)devices.get(0);
CLDevice device2 = (CLDevice)devices.get(1);
CLDevice device3 = (CLDevice)devices.get(2);
CLContext context = JavaCL.createContext(null, device1, device2, device3);
But I got error when try to use 3 at the same. So How can compile CPU and GPUs in JavaCL ? Because I read that OpenCL is standard to support parallel programming by using CPU and GPU. So If I miss something, please let me know. Any idea or answers will be appreciated.
Thanks,
Duy.
Sadly, its not that easy. When creating a single context across multiple devices, the devices all have to come from the same platform. Creating a context containing the Intel CPU and GPU should work, but the Nvidia GPU has to be in its own context (different platform, Nvidia not Intel).
Here's how I handle this scenario: I create a context for each device and a thread for each context. Each thread takes a portion of the data I'm working on and dispatches it to its assigned OpenCL device. This way, you can mix, CPUs, GPUs from both AMD and Nvidia, and any other hardware that comes along.
Its important to do load balancing across the threads so that you don't have faster devices sitting idle waiting for a slower device to catch up.