Advanced search

Message boards : Graphics cards (GPUs) : Why does GPU process take 0.5 (or whatever) CPU time?

Author Message
Palamedes
Send message
Joined: 19 Mar 11
Posts: 30
Credit: 109,550,770
RAC: 0
Level
Cys
Scientific publications
watwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwat
Message 23071 - Posted: 22 Jan 2012 | 2:40:04 UTC

Is the CPU usage for GPU tasks just dispatcher overhead or is there actual computational stuff going on too?

Profile skgiven
Volunteer moderator
Volunteer tester
Avatar
Send message
Joined: 23 Apr 09
Posts: 3968
Credit: 1,995,359,260
RAC: 0
Level
His
Scientific publications
watwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwat
Message 23072 - Posted: 22 Jan 2012 | 2:47:26 UTC - in response to Message 23071.

Varies with different task types. Most of the more recent tasks are fairly CPU lite. Tasks that use more CPU are supposed to award slightly higher credit to compensate for the CPU usage.
____________
FAQ's

HOW TO:
- Opt out of Beta Tests
- Ask for Help

jlhal
Send message
Joined: 1 Mar 10
Posts: 147
Credit: 1,077,535,540
RAC: 0
Level
Met
Scientific publications
watwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwat
Message 23082 - Posted: 22 Jan 2012 | 16:53:20 UTC - in response to Message 23072.

Varies with different task types. Most of the more recent tasks are fairly CPU lite. Tasks that use more CPU are supposed to award slightly higher credit to compensate for the CPU usage.

Since I changed my GTX460so for a GTX590 I noticed the following:
GTX460: with CPU usage set to 85% of the 6 cores, it used 1 CPU with some percentage I forgot to notice (about 0.12 or higher) and 5 for WCG
GTX590 (2GPUs) : Same CPU core ration set to 85%, it uses 0.51 of one CPU for each GPU, so 4 remaining for WCG.

There's something wrong: It should not use more than one CPU for GPUGRID because
85% of 6 is 5.1 !
It seems that one CPU cannot be shared among 2 GPUs and it allocates one CPU for each GPU despite the CPU usage ratio I set.

So what is the real allocation algorithm ?
____________
Lubuntu 16.04.1 LTS x64

Profile skgiven
Volunteer moderator
Volunteer tester
Avatar
Send message
Joined: 23 Apr 09
Posts: 3968
Credit: 1,995,359,260
RAC: 0
Level
His
Scientific publications
watwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwat
Message 23089 - Posted: 22 Jan 2012 | 21:53:44 UTC - in response to Message 23082.
Last modified: 22 Jan 2012 | 22:08:20 UTC

When you set Boinc to use 5 of the 6 CPU's, all you are doing is telling Boinc to free up one CPU to facilitate GPU usage. You are not specifically instructing Boinc to only use 1 CPU for GPU tasks. The GPU tasks will use whatever is needed. This is not unique to GPUGrid, it's the same on other GPU projects, and different projects require different amounts of the CPU to facilitate GPU tasks.

If you don't free the CPU then you can often run into trouble. The system becomes sluggish, tasks compete for the same resources and failures increase.

For a 6Core CPU (approx.) Boinc 6.10:
(On Multi-processor systems use at most)
100% = use all 6 CPU cores to crunch CPU tasks & GPU tasks
83.33% to 99.99% = use 5cores for CPU tasks (GPU will use what it needs)
66.66% to 83.33% = use 4cores
50% to 66.66% = use 3cores
33.33% to 50% = use 2cores
16.66% to 33.33% = use 1core
0.01% to 16.66% = use 1core AFAICT
0.00% = use 6 CPU cores to crunch CPU and GPU tasks!

In theory, GPU tasks run at a slightly higher priority than CPU tasks, so when the GPU needs to use the CPU it gets prioritized. However this is not exactly foolproof and typically the GPU tasks have to wait a small amount of time to use the CPU, which slows down the GPU task overall. Hence some people go to extreme lengths to optimize for the GPU (Process lasso, eFmer, SWAN_SYNC).

A GTX460 is CC2.1 and your GTX590 is newer generation CC2.0 card. Your GTX590 performance is slightly more than four times that of a GTX460 at GPUGrid. So the amount of CPU required to accommodate the GPU has more than quadrupled from a single GTX460.

If you use SWAN_SYNC you should free at least one CPU for every GPU. If not the requirement from the CPU to facilitate various GPU tasks will change somewhat with the task type. So for example, a TONI task might use 35% of one CPU core (while running on a GTX590), a GIANNI task might require 16% of one CPU core and a NATHAN task might require 51%.

Personally, I never saturate the CPU, because I'm GPU orientated, I use my systems and I like responsiveness. With a GTX590 and a 6core (~57GFlops) I would free at least 2 CPU cores if I was going to use the system.
____________
FAQ's

HOW TO:
- Opt out of Beta Tests
- Ask for Help

jlhal
Send message
Joined: 1 Mar 10
Posts: 147
Credit: 1,077,535,540
RAC: 0
Level
Met
Scientific publications
watwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwat
Message 23091 - Posted: 22 Jan 2012 | 23:08:43 UTC - in response to Message 23089.

Personally, I never saturate the CPU, because I'm GPU orientated, I use my systems and I like responsiveness. With a GTX590 and a 6core (~57GFlops) I would free at least 2 CPU cores if I was going to use the system.


Thanks a lot for these precisions
I'm using my 6 cores Linux PC with the GTX590 only for GPUGRID and WCG.
I use another one (Win7, 4cores) for GPUGRID,WCG and other works.

PS : GIANNI and NATHAN take each 0.51 according to Boinc manager.
For me using 4 cores for WCG needs to set 84% .
SWAN_SYNC is set and 2 cores are used for GPU.
____________
Lubuntu 16.04.1 LTS x64

DavidVR
Send message
Joined: 20 Jan 11
Posts: 6
Credit: 10,705,495
RAC: 0
Level
Pro
Scientific publications
watwatwatwatwatwatwatwatwatwat
Message 23093 - Posted: 23 Jan 2012 | 9:47:38 UTC

Because CUDA requires that the CPU instructs the GPU calculations.

Grutte Pier [Wa Oars]~MAB...
Send message
Joined: 8 Jan 12
Posts: 20
Credit: 5,132,859
RAC: 0
Level
Ser
Scientific publications
watwatwatwatwat
Message 23226 - Posted: 3 Feb 2012 | 11:51:35 UTC
Last modified: 3 Feb 2012 | 12:49:36 UTC

I have 2 Phenom II X4 945 / GTX460 combo's, one (SC) crunching on GPUGRID and Malariacontrol and the other one (FTW) on GPUGRID and R@H.
What would I gain in speed/production if I dedicate one core to GPUGRID ?

And should I use the SWAN_SYNC=0 environmental setting to achieve this or just set boinc to 75% ?

Grutte Pier [Wa Oars]~MAB...
Send message
Joined: 8 Jan 12
Posts: 20
Credit: 5,132,859
RAC: 0
Level
Ser
Scientific publications
watwatwatwatwat
Message 23228 - Posted: 3 Feb 2012 | 12:52:47 UTC

It looks like setting boinc to 75% slows speed down considerably.

Profile skgiven
Volunteer moderator
Volunteer tester
Avatar
Send message
Joined: 23 Apr 09
Posts: 3968
Credit: 1,995,359,260
RAC: 0
Level
His
Scientific publications
watwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwatwat
Message 23236 - Posted: 3 Feb 2012 | 17:15:24 UTC - in response to Message 23228.
Last modified: 3 Feb 2012 | 17:24:19 UTC

As you use Windows SWAN_SYNC is not necessary, but it would still probably increase GPU task performance slightly (a few percent). If you use SWAN_SYNC you must free up a CPU core to gain any benefit and restart, but on a quad without HT and a mid range GPU it's a bit much to lose a full CPU core for such a small GPU increase. With a higher end GPU the picture would change significantly; a GTX590 for example would do 4times the work of a GTX460 and would use a full CPU core (or more) anyway.

With your systems I would probably stick to crunching on 4 CPU cores and not use SWAN_SYNC (if I did not use the system much). If you use your system a lot, you might want to free up a CPU core just to improve system responsiveness. I did make a request one time for Boinc to facilitate using one CPU core less when the system is in use, but as yet this has not been implemented.

When freeing up a CPU core you never actually loose a full core.
Operating systems tend to use around 3% of an average quad CPU, and even a highly optimized high end system uses some CPU just for the operating system, even if it's only ~1%.
When running a GPU application that requires some CPU (and all do to some extent) the loss is further reduced (say by 10% of one CPU core). The gain in GPU performance usually makes up for lost CPU performance (in terms of Boinc credit). Just remember SWAN_SYNC is different and does use a full CPU core.
____________
FAQ's

HOW TO:
- Opt out of Beta Tests
- Ask for Help

Grutte Pier [Wa Oars]~MAB...
Send message
Joined: 8 Jan 12
Posts: 20
Credit: 5,132,859
RAC: 0
Level
Ser
Scientific publications
watwatwatwatwat
Message 23237 - Posted: 3 Feb 2012 | 18:49:09 UTC

@ skgiven : Thanks for your info.

At the moment I want to get my subteam (GP) as fast as possible into the top 30 (or higher) at DPC so I've set one core entirely on GPUGRID and SWAN_SYNC=0.

Grutte Pier [Wa Oars]~MAB...
Send message
Joined: 8 Jan 12
Posts: 20
Credit: 5,132,859
RAC: 0
Level
Ser
Scientific publications
watwatwatwatwat
Message 23241 - Posted: 3 Feb 2012 | 22:51:54 UTC
Last modified: 3 Feb 2012 | 23:07:17 UTC

And changed boinc preferences back to 100% 'cause boinc tends to change parameters randomly sometimes and than they all change as it did now.
Left SWAN however but don't know it's doing something.
And deleted that too after a SWAN: Using synchronization method 0
MDIO: cannot open file "restart.coor" error.

Simba123
Send message
Joined: 5 Dec 11
Posts: 147
Credit: 69,970,684
RAC: 0
Level
Thr
Scientific publications
watwatwatwatwatwatwatwatwatwatwatwat
Message 23405 - Posted: 12 Feb 2012 | 1:25:25 UTC

I have an i7-2600k @4.5
1 560 ti
1 460

I let all 8 cores crunch gpu grid and the
gpus take .5 cores each.

seems to work fine

crunches 8 wcg tasks and the 2 gpugrid at the same time.

the wcg tasks may run a bit slower, but still easily complete
before the due date, as do both my GPUS even on long runs.

Post to thread

Message boards : Graphics cards (GPUs) : Why does GPU process take 0.5 (or whatever) CPU time?

//