OpenCL vs CUDA

If you're new to FAH and need help getting started or you have very basic questions, start here.

Moderators: Site Moderators, FAHC Science Team

Post Reply
Asgaroth
Posts: 29
Joined: Sun Dec 09, 2018 12:06 am

OpenCL vs CUDA

Post by Asgaroth »

Hi All,

Just a simple question, when the FaH client supported CUDA did it use less CPU cycles to drive the GPU's? It seems that OpenCL hammers the CPU's to feed the GPU's. I do have the CPU slot removed so the client is not using my CPU's at all to crunch work units.

I've done a quick search to see if I could find this answered elsewhere but my google-fu has failed me.

Thanks
There are two major products that came out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence.
-- Jeremy S. Anderson
JimboPalmer
Posts: 2522
Joined: Mon Feb 16, 2009 4:12 am
Location: Greenwood MS USA

Re: OpenCL vs CUDA

Post by JimboPalmer »

Yes. CUDA is Nvidia only. Nvidia's OpenCL driver does a 'busy wait' on one CPU, busy waiting is almost always a poor design. AMD does not use a busy wait, so draws less CPU.

The Pande Group has limited funds so has focused on a single GPU model, OpenCL. In the past, they supported multiple cores based on vendor specific platforms but at some additional cost. (Funded by Nvidia and AMD?)

In some theoretical world with infinite funds and infinite programmer support, multiple cores written for every variation would yield faster results. As it is, we are stuck with Nvidia's poor design choice. (If they can force you to use CUDA software, they have a monopoly on hardware)

It is somewhat excusable when GPU folding is 100s of times more points than CPU folding.

https://en.wikipedia.org/wiki/Busy_waiting

(In a past life I had a busy wait I could not avoid, but I could run it on any CPU on my network. I used the slowest device I could find. ARM has a similar feature called big.LITTLE, but x86 does not)
Tsar of all the Rushers
I tried to remain childlike, all I achieved was childish.
A friend to those who want no friends
Asgaroth
Posts: 29
Joined: Sun Dec 09, 2018 12:06 am

Re: OpenCL vs CUDA

Post by Asgaroth »

Thanks for the reply, I was just wondering if there would ever be an opportunity for nvidia users to use cuda only thereby freeing up the cpu to feed more gpu's (for example, amd gpu's). Based on your response above this appears that it is unlikely to happen.
There are two major products that came out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence.
-- Jeremy S. Anderson
bruce
Posts: 20824
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: OpenCL vs CUDA

Post by bruce »

A busy-wait process is designed to waste CPU power in a way that improves response time ... the latter being an important consideration for gamers who detest the extra overhead required to interrupt another process to get attention by the CPU. While a busy-wait appears to use a lot of CPU cycles, it's easily interrupted by another process -- and no interruption is required to begin processing work assigned to the GPU driver processes.
foldy
Posts: 2040
Joined: Sat Dec 01, 2012 3:43 pm
Hardware configuration: Folding@Home Client 7.6.13 (1 GPU slots)
Windows 7 64bit
Intel Core i5 2500k@4Ghz
Nvidia gtx 1080ti driver 441

Re: OpenCL vs CUDA

Post by foldy »

Now FAH has enabled CUDA on nvidia GPUs. But I see also one CPU core used by FAH to feed the GPU slot.

OpenMM has the option to use blocking sync instead of busy waiting. Can this be enabled by FAH user in the FahClient? How much does it hurt PPD?
UseBlockingSync: This is used to control how the CUDA runtime synchronizes between the CPU and GPU. If this is set to “true” (the default), CUDA will allow the calling thread to sleep while the GPU is performing a computation, allowing the CPU to do other work. If it is set to “false”, CUDA will spin-lock while the GPU is working.
https://github.com/openmm/openmm/blob/1 ... cifics.rst
TheDevil
Posts: 22
Joined: Mon Aug 15, 2022 11:21 am

Re: OpenCL vs CUDA

Post by TheDevil »

foldy wrote: Mon Oct 03, 2022 6:28 am Now FAH has enabled CUDA on nvidia GPUs. But I see also one CPU core used by FAH to feed the GPU slot.

OpenMM has the option to use blocking sync instead of busy waiting. Can this be enabled by FAH user in the FahClient? How much does it hurt PPD?
UseBlockingSync: This is used to control how the CUDA runtime synchronizes between the CPU and GPU. If this is set to “true” (the default), CUDA will allow the calling thread to sleep while the GPU is performing a computation, allowing the CPU to do other work. If it is set to “false”, CUDA will spin-lock while the GPU is working.
https://github.com/openmm/openmm/blob/1 ... cifics.rst
How do I enable Cuda?
foldy
Posts: 2040
Joined: Sat Dec 01, 2012 3:43 pm
Hardware configuration: Folding@Home Client 7.6.13 (1 GPU slots)
Windows 7 64bit
Intel Core i5 2500k@4Ghz
Nvidia gtx 1080ti driver 441

Re: OpenCL vs CUDA

Post by foldy »

It is enabled automatically on Nvidia GPUs if supported. You see it in the logfile in FahControl
e.g.
06:17:57:WU00:FS01:0x22:Platform 2: OpenCL
06:17:57:WU00:FS01:0x22: opencl-device 0 specified
06:17:57:WU00:FS01:0x22:Platform 3: CUDA
06:17:57:WU00:FS01:0x22: cuda-device 0 specified
06:18:10:WU00:FS01:0x22:Attempting to create CUDA context:
06:18:10:WU00:FS01:0x22: Configuring platform CUDA
06:18:15:WU00:FS01:0x22: Using CUDA and gpu 0
Joe_H
Site Admin
Posts: 7937
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: OpenCL vs CUDA

Post by Joe_H »

TheDevil wrote: Tue Oct 04, 2022 9:31 am How do I enable Cuda?
As stated by foley, it is used automatically if you have a GPU that is compatible. CUDA is proprietary to Nvidia, and in compiling the GPU folding core the libraries and support in the drivers currently require a GPU using a Maxwell or later series chipset. That would be the GTX 745, 750, and GT(X) 900 series cards are the minimum for CUDA, the older GT 600 and 700 cards using Kepler chipsets will use OpenCL. There are some GT 600/700 cards using Fermi chips, those are no longer supported for folding at all as the Fermi chipset does not support OpenCL 1.2.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
Post Reply