4 ms·
I really don't understand this - it's very easy to set which device (CPU / GPU) your OpenCL code is running on and to avoid running on the CPU if you don't want
by klelatti 6y ago
I really don't understand this - it's very easy to set which device (CPU / GPU) your OpenCL code is running on and to avoid running on the CPU if you don't want that.
On the other hand the ability to test on GPU-less systems is very useful indeed.
OpenCL has lots of faults but the ability to use a CPU with the appropriate drivers when a GPU isn't available surely isn't one of them.
- andromeduck 6y agoFYI cuda has that too, so they're probably talking about default behavior.
- klelatti 6y agoIs that right? From the Nvidia docs: "To use CUDA on your system, you will need the following installed: A CUDA-capable GPU" There might be some open source projects that support CUDA Kernels on the CPU but the ones I've found are all abandoned.
- tehsauce 6y agoYou're right,cuda is only officially supported to run on an nvidia gpu, not cpu or anywhere else.
- Robadob 6y agoHistorically there was an emulator mode, where you could build your CUDA code to run on CPU. However, it was removed a few years ago. I never used it, so can't really give you more details beyond that.
- MaxBarraclough 6y ago> On the other hand the ability to test on GPU-less systems is very useful indeed. Ideally OpenCL's support for CPUs shouldn't just be for testing - it should be able to make efficient use of the CPU's SIMD. Intel still support OpenCL for CPU. [0] AMD used to, but they dropped support for CPU devices, at least on Windows. Perhaps they still support them on Linux. [1][2] [0] https://software.intel.com/content/www/us/en/develop/articles/opencl-drivers.html https://software.intel.com/content/www/us/en/develop/article... [1] https://community.amd.com/thread/231410#comment-2875387 https://community.amd.com/thread/231410#comment-2875387 [2] https://old.reddit.com/r/Amd/comments/aun3y2/amd_cpus_no_longer_have_opencl_support/eha5j2t/ https://old.reddit.com/r/Amd/comments/aun3y2/amd_cpus_no_lon...
- klelatti 6y agoAgree 100% and I was imprecise in my wording. I'm actually using AMD CPU drivers (OpenCL2 on Ubuntu 20.04) in a project that I hope will be in production over the next month or so. Speed is more than acceptable for my purposes. Tried to use Intel but didn't manage to get working. AMD's were a breeze by comparison. I'd be very interested in hearing about others experiences and any benchmark AMD vs Intel comparisons.
- MaxBarraclough 6y agoGood to hear AMD haven't completely done away with their OpenCL-on-CPU. Have you compared the performance against alternative technologies like OpenMP? Years ago I had the Intel OpenCL running on an Intel CPU (the machine ran Windows) and AMD OpenCL running on an AMD CPU (that machine also ran Windows). AMD's Visual Studio plugin for OpenCL was really pretty good. Haven't used OpenCL since though so I can't really comment on the current state of things.
- klelatti 6y agoUsing some OpenMP but the code is exceptionally well suited to the OpenCL Kernel approach plus the ability to explore use of GPUs at some point in future is helpful. Thanks for the links - I'll have a look at the Intel drivers again and see if I have any more success!