Should I leave cores or threads free for GPU?

Message boards : Number crunching : Should I leave cores or threads free for GPU?
Message board moderation

To post messages, you must log in.

1 · 2 · 3 · 4 · Next

AuthorMessage
Ryan Munro

Send message
Joined: 5 Feb 06
Posts: 63
Credit: 18,519,866
RAC: 10
United Kingdom
Message 1965103 - Posted: 14 Nov 2018, 11:36:07 UTC

So I am aware that I need to leave CPU time free for GPU units and the units show in the app that they need about 0.9 CPU's.
Would a single thread be enough or will it need the resource of a full core?

Currently, I have two GPU's installed and have the CPU usage set to 70%, this means it runs 11 CPU jobs on my 8 core 16 thread chip, the chip seems to run at about 95% usage in task manager.

if I bumped it to 85% usage which should in theory (ill check tonight) push Boinc to run 13 - 14 CPU units will this leave enough CPU time free to not starve the GPU units?

What's everyone else's setup? is there a best practice for running CPU and GPU?
ID: 1965103 · Report as offensive
rob smith Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer moderator
Volunteer tester

Send message
Joined: 7 Mar 03
Posts: 22202
Credit: 416,307,556
RAC: 380
United Kingdom
Message 1965105 - Posted: 14 Nov 2018, 12:44:13 UTC

95% usage in task manager for the CPU is about as high as you want to go - pushing the % available from 70% to 85% will push you into overload, and almost certainly result in reduced performance.
The "use 0.9 CPU" is not an actual usage figure, but more a guessed at target. There will be times when the CPU usage for a given task is near zero and others when the same task will grab a full CPU core (or thread).
Bob Smith
Member of Seti PIPPS (Pluto is a Planet Protest Society)
Somewhere in the (un)known Universe?
ID: 1965105 · Report as offensive
Richard Haselgrove Project Donor
Volunteer tester

Send message
Joined: 4 Jul 99
Posts: 14650
Credit: 200,643,578
RAC: 874
United Kingdom
Message 1965107 - Posted: 14 Nov 2018, 12:50:05 UTC

It depends entirely on the application being run. OpenCL applications are likely to require a free core, CUDA applications don't. But BOINC doesn't recognise this distinction, and will display the same (erroneous) 0.9xx estimate for both application types.
ID: 1965107 · Report as offensive
Ryan Munro

Send message
Joined: 5 Feb 06
Posts: 63
Credit: 18,519,866
RAC: 10
United Kingdom
Message 1965113 - Posted: 14 Nov 2018, 14:21:26 UTC

Cheers both cards are Nvidia, ill leave as is then as the CPU usage is very close to 100% as is.
ID: 1965113 · Report as offensive
Profile Keith Myers Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 29 Apr 01
Posts: 13164
Credit: 1,160,866,277
RAC: 1,873
United States
Message 1965134 - Posted: 14 Nov 2018, 16:26:05 UTC - in response to Message 1965113.  

The detriment in increasing the cpu usage per gpu won't be in the gpu task, it will be in increasing the run_time of the cpu tasks.
Seti@Home classic workunits:20,676 CPU time:74,226 hours

A proud member of the OFA (Old Farts Association)
ID: 1965134 · Report as offensive
Profile Mike Special Project $75 donor
Volunteer tester
Avatar

Send message
Joined: 17 Feb 01
Posts: 34258
Credit: 79,922,639
RAC: 80
Germany
Message 1965145 - Posted: 14 Nov 2018, 17:15:08 UTC
Last modified: 14 Nov 2018, 17:17:01 UTC

Your GPU crunch time will reduce significantly freeing at least one core.


With each crime and every kindness we birth our future.
ID: 1965145 · Report as offensive
Profile Tom M
Volunteer tester

Send message
Joined: 28 Nov 02
Posts: 5124
Credit: 276,046,078
RAC: 462
Message 1965147 - Posted: 14 Nov 2018, 17:22:14 UTC - in response to Message 1965103.  
Last modified: 14 Nov 2018, 17:22:55 UTC

What's everyone else's setup? is there a best practice for running CPU and GPU?


Best results depends heavily on exactly what your hardware is, what OS/Apps you are running etc.

If you were running 100% of your cpus at 100% of the cpu time, then reducing it to 90% of your cpus "should" release more resources for the gpu's to use to crunch with as well as providing some "reserve" power that other cpu's can use as needed. Often 80%-85% makes good sense because it increases your total production.

It gets trickier with low core systems. If you had a 4 core system, there have been good results with idling 1 core. Especially in the APU (Amd integrated cpu/gpu) systems.

I have a 8 thread system that is running Windows and a mix of Seti and a bunch of other apps. Even with suspending the gpu when I was on the system, it became a little laggy because I was running so many tasks. So that one got reduced to 75%-80%.

You are running standard Seti under Windows at the moment. So using 1 cpu core to drive 1 gpu task for the SOG tasks makes perfect sense. Once you have a solid baseline of 1 task per video card, you can try 2 tasks per video card. While the absolute speed of your gpu tasks might decrease some, your total production may go up. It is even possible production will go up with 3 tasks video card.

You have to try it out and see. If you weren't running those Titan's I would not be suggesting multiple gpu tasks. For cards less than the gtx 1080/Titan the results are almost always much slower.

Tom
A proud member of the OFA (Old Farts Association).
ID: 1965147 · Report as offensive
Profile Zalster Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 27 May 99
Posts: 5517
Credit: 528,817,460
RAC: 242
United States
Message 1965162 - Posted: 14 Nov 2018, 18:44:36 UTC - in response to Message 1965147.  

And here we start again with the % of CPU cores to be used.

It doesn't do what you think it does.

If you don't want to use all your CPU thread then insert a <project_max_current>N</project_max_concurrent> into your app_config.xml and set 100% of all CPU threads.

GPU will be given preference and when there is no GPU work, the CPU will pick up the extra thread. Example, an 16 thread CPU with 2 GPUs(if only 1 work unit per GPU)and 10 CPU work units would a value of 12 .. If 2 work units per GPU then it would be 4 GPU and 8 CPU work unit with the continue value of 12 in project max current. When the GPU run of of work, 4 more CPU work units would start and then there would be 12 max work units running. When fresh GPU work is available, 4 CPU would be suspended and the GPUs would start up again. Those 4 suspended would finish up whenever a CPU thread frees up.

The concept that reducing CPU usage to 90% frees up a core is wrong. The only thing you have done is reduced the number of threads that are processing the same amount of work. That "free" thread isn't going to be used by the GPUs. Because you specifically told BOINC that it isn't allowed to use the 10%. So the GPUs are going to be stealing cycles from the other threads. If you want the GPU to have a unused thread, it has to be able to use any non used thread.
ID: 1965162 · Report as offensive
Profile Keith Myers Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 29 Apr 01
Posts: 13164
Credit: 1,160,866,277
RAC: 1,873
United States
Message 1965165 - Posted: 14 Nov 2018, 19:16:19 UTC - in response to Message 1965162.  

Zalster has hit the issue correctly on the nose.
+1
Seti@Home classic workunits:20,676 CPU time:74,226 hours

A proud member of the OFA (Old Farts Association)
ID: 1965165 · Report as offensive
Profile Siran d'Vel'nahr
Volunteer tester
Avatar

Send message
Joined: 23 May 99
Posts: 7379
Credit: 44,181,323
RAC: 238
United States
Message 1965200 - Posted: 14 Nov 2018, 22:34:49 UTC - in response to Message 1965165.  

Zalster has hit the issue correctly on the nose.
+1

Hi Keith,

It's a good thing I keep reading these threads, even if something comes up that I don't quite understand.

I was looking at what Zalster said and checked the "documentation" to see what to do. I want 10 threads doing WUs while the GPU does 2, since I have a 6 core 12 thread CPU.

This is what I came up with, but I believe it to be wrong:
<app_config>
	<app_version>
		<app_name>setiathome_v8</app_name>
		<plan_class>alt</plan_class>
		<max_concurrent>10</max_concurrent>
	</app_version>
	<app_version>
		<app_name>setiathome_v8</app_name>
		<plan_class>opencl_nvidia_SoG</plan_class>
		<avg_ncpus>0.20</avg_ncpus>
		<ngpus>0.5</ngpus>
	</app_version>
	<app_version>
		<app_name>astropulse_v7</app_name>
		<plan_class>opencl_nvidia_100</plan_class>
		<avg_ncpus>0.20</avg_ncpus>
		<ngpus>0.5</ngpus>
	</app_version>
</app_config>

The first app_version is what I added today going by the "documentation" and what I see in my tasks list in the manager. I changed the "Use at most x% of the CPUs" to 100%. I'm now running 12 and 2 which is not what I want. Could you steer me in the correct direction for what I want to achieve please? :)

Unbelievably though, I don't see a great deal of lag... ;)

Have a great day! :)

Siran
CAPT Siran d'Vel'nahr - L L & P _\\//
Winders 11 OS? "What a piece of junk!" - L. Skywalker
"Logic is the cement of our civilization with which we ascend from chaos using reason as our guide." - T'Plana-hath
ID: 1965200 · Report as offensive
Profile Keith Myers Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 29 Apr 01
Posts: 13164
Credit: 1,160,866,277
RAC: 1,873
United States
Message 1965213 - Posted: 14 Nov 2018, 23:18:25 UTC - in response to Message 1965200.  

You need to put a project max concurrent statement outside the app version statement.
<app_config>
	<app_version>
		<app_name>setiathome_v8</app_name>
		<plan_class>opencl_nvidia_SoG</plan_class>
		<avg_ncpus>0.20</avg_ncpus>
		<ngpus>0.5</ngpus>
	</app_version>
	<app_version>
		<app_name>astropulse_v7</app_name>
		<plan_class>opencl_nvidia_100</plan_class>
		<avg_ncpus>0.20</avg_ncpus>
		<ngpus>0.5</ngpus>
	</app_version>
<project_max_concurrent>10</project_max_concurrent>
</app_config>

There's two different concurrent tasks tags in the docs. One is applied to each app_version or task type. Your original app_config says to run 10 MB tasks max as well as 2 AP tasks when they hit the gpu. So any max_concurrent statement within an app_version block only affects that block. You could use another max_concurrent statement in the AP block for example.
The project_max_concurrent applies to the entire project regardless how many applications are defined for use in the project. This is the kind of tag you want to use to limit at all times and type of tasks to maximum of 10 tasks running at any time.
Seti@Home classic workunits:20,676 CPU time:74,226 hours

A proud member of the OFA (Old Farts Association)
ID: 1965213 · Report as offensive
Profile Siran d'Vel'nahr
Volunteer tester
Avatar

Send message
Joined: 23 May 99
Posts: 7379
Credit: 44,181,323
RAC: 238
United States
Message 1965330 - Posted: 15 Nov 2018, 11:21:55 UTC - in response to Message 1965213.  
Last modified: 15 Nov 2018, 11:35:25 UTC

You need to put a project max concurrent statement outside the app version statement.
<app_config>
	<app_version>
		<app_name>setiathome_v8</app_name>
		<plan_class>opencl_nvidia_SoG</plan_class>
		<avg_ncpus>0.20</avg_ncpus>
		<ngpus>0.5</ngpus>
	</app_version>
	<app_version>
		<app_name>astropulse_v7</app_name>
		<plan_class>opencl_nvidia_100</plan_class>
		<avg_ncpus>0.20</avg_ncpus>
		<ngpus>0.5</ngpus>
	</app_version>
<project_max_concurrent>10</project_max_concurrent>
</app_config>

There's two different concurrent tasks tags in the docs. One is applied to each app_version or task type. Your original app_config says to run 10 MB tasks max as well as 2 AP tasks when they hit the gpu. So any max_concurrent statement within an app_version block only affects that block. You could use another max_concurrent statement in the AP block for example.
The project_max_concurrent applies to the entire project regardless how many applications are defined for use in the project. This is the kind of tag you want to use to limit at all times and type of tasks to maximum of 10 tasks running at any time.

Hi Keith,

Well, it looks like I misunderstood what max_concurrent and project_max_concurrent meant. Ok, I'll make that change and see how things go. :)

Running as it is right now, my lag diminished a bit and my temps are about the same, high 40s to low 50s. :)

Thanks Keith and have a great day! :)

Siran

[edit]
I had to change the project_max_concurrent value to 12. When I first made the change to my app_config.xml file and read the config files into BOINC, I was only running 8 and 2. 12 gives me 10 and 2 which is what I wanted. Woohoo! ;)
[/edit]
CAPT Siran d'Vel'nahr - L L & P _\\//
Winders 11 OS? "What a piece of junk!" - L. Skywalker
"Logic is the cement of our civilization with which we ascend from chaos using reason as our guide." - T'Plana-hath
ID: 1965330 · Report as offensive
Profile Keith Myers Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 29 Apr 01
Posts: 13164
Credit: 1,160,866,277
RAC: 1,873
United States
Message 1965363 - Posted: 15 Nov 2018, 16:23:51 UTC

Great, glad it is finally running the way you want it run. I use project_max_concurrent on all my hosts. Basically I have only cpu tasks running on physical cores and the HT cores feed the gpus.
Seti@Home classic workunits:20,676 CPU time:74,226 hours

A proud member of the OFA (Old Farts Association)
ID: 1965363 · Report as offensive
Profile Siran d'Vel'nahr
Volunteer tester
Avatar

Send message
Joined: 23 May 99
Posts: 7379
Credit: 44,181,323
RAC: 238
United States
Message 1965374 - Posted: 15 Nov 2018, 16:50:12 UTC - in response to Message 1965363.  

Great, glad it is finally running the way you want it run. I use project_max_concurrent on all my hosts. Basically I have only cpu tasks running on physical cores and the HT cores feed the gpus.

Thanks Keith. I don't believe running mine the way you do would be prudent since I only have 1 GPU I'm using. I don't plan on installing any more. If I have a PC dedicated to SETI, that might be a different story, but I don't. ;) The house is too small.

Have a great day! :)

Siran
CAPT Siran d'Vel'nahr - L L & P _\\//
Winders 11 OS? "What a piece of junk!" - L. Skywalker
"Logic is the cement of our civilization with which we ascend from chaos using reason as our guide." - T'Plana-hath
ID: 1965374 · Report as offensive
Profile Tom M
Volunteer tester

Send message
Joined: 28 Nov 02
Posts: 5124
Credit: 276,046,078
RAC: 462
Message 1965387 - Posted: 15 Nov 2018, 18:33:28 UTC - in response to Message 1965162.  

And here we start again with the % of CPU cores to be used.

It doesn't do what you think it does.

If you don't want to use all your CPU thread then insert a <project_max_current>N</project_max_concurrent> into your app_config.xml and set 100% of all CPU threads.

GPU will be given preference and when there is no GPU work, the CPU will pick up the extra thread. Example, an 16 thread CPU with 2 GPUs(if only 1 work unit per GPU)and 10 CPU work units would a value of 12 .. If 2 work units per GPU then it would be 4 GPU and 8 CPU work unit with the continue value of 12 in project max current. When the GPU run of of work, 4 more CPU work units would start and then there would be 12 max work units running. When fresh GPU work is available, 4 CPU would be suspended and the GPUs would start up again. Those 4 suspended would finish up whenever a CPU thread frees up.

The concept that reducing CPU usage to 90% frees up a core is wrong. The only thing you have done is reduced the number of threads that are processing the same amount of work. That "free" thread isn't going to be used by the GPUs. Because you specifically told BOINC that it isn't allowed to use the 10%. So the GPUs are going to be stealing cycles from the other threads. If you want the GPU to have a unused thread, it has to be able to use any non used thread.


I didn't mean to imply the idled core(s) would be used by the gpus. In fact, I don't want the idled cores to be used at all. In a highly MIXED environment, the "project_max_concurrent" doesn't cut it when I want to run less than 100% of my cpu cores. I have tried it and to use it I had to do a total# of tasks across all projects to limit it below the 100%. The result was it caused my system to run the project maximum well below the 90% of cores when there were no tasks available from the other projects.

And I want to run less than 100% of my cores because the entire system runs faster and processes more tasks. True if you drop the % too low, you can speed up the processing of the cpus while reducing the total production. A 90% load on the whole system seems to be a good starting point. I also do this in my Seti dedicated environment(s) for the same reasoning. It runs faster if there are about 10% idled/unused by BoincMgr cores.

It sounds like the project_max_concurrent setting would work the way you describe when you have 1 cpu driving 1 gpu task. For environments where the cpu task is say 0.1 per gpu task it, I think it won't work as you described. On my largest intel box running Linux/CUDA91 I am not running 1 core per gpu task. In that specific instance the gpu(s) appear to be running as fast as it is possible to run even without a full cpu core driving it.

I think your logic works very well in a Seti dedicated system that requires 1 cpu per gpu task.

But I think your solution is a "one size fits all" solution that doesn't fit all sizes.

Respectfully,
Tom
A proud member of the OFA (Old Farts Association).
ID: 1965387 · Report as offensive
Profile Zalster Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 27 May 99
Posts: 5517
Credit: 528,817,460
RAC: 242
United States
Message 1965394 - Posted: 15 Nov 2018, 19:23:58 UTC - in response to Message 1965387.  

And you are welcome to your "opinion" but I don't run 1 core 1 gpu. I run 12, 16, 20 thread with 3 and 4 GPUs across 3 projects. So my "solution" does work.

First "project max concurrent" only applies that project where it is used. So of course it will not affect "other" projects. It's not meant to. It's only affecting the project to which it is assigned.

Doing multiple projects requires you to remember what the limits you are placing on each project. That means both website preference and local ie.. max concurrent or project max concurrent in each different project. It's a balancing act that you will need to spend time figuring out just how to set each project. I've spent months on different projects learning how to tune my systems for each. I used that information to balance out my computers so that run at their fastest configuration. There is no "one key fits all". Your system may run "faster" with the % of cpu but it's probably not at its' most efficient design.

Z
ID: 1965394 · Report as offensive
Profile Keith Myers Special Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 29 Apr 01
Posts: 13164
Credit: 1,160,866,277
RAC: 1,873
United States
Message 1965399 - Posted: 15 Nov 2018, 19:31:34 UTC

Tom, you still haven't got the concept that ONLY the gpu application determines the amount of cpu it uses. Yes you can force the special app with the -nobs option but the improvement is minor overall in a high cpu/gpu count system. I run without it and let the gpu application pull whatever cpu resources it needs from whatever cpu cores are available.

I don't run any exclusive Seti host other than the HEDT host. All other hosts jump around on all my projects as necessary to balance the project debts. Right now I see my cpu utilization running at 57%. I see 8 cores out of 16 idling around 10-25% while 8 cores are pegged at 100%. That is the way I want my hosts to run. Cpu tasks pegged to a physical core and running flat out and the others loafing along supporting my desktop browsing and feeding my gpus.

And I do all that with a project_max_concurrent statement in each projects app_config.
Seti@Home classic workunits:20,676 CPU time:74,226 hours

A proud member of the OFA (Old Farts Association)
ID: 1965399 · Report as offensive
TBar
Volunteer tester

Send message
Joined: 22 May 99
Posts: 5204
Credit: 840,779,836
RAC: 2,768
United States
Message 1965403 - Posted: 15 Nov 2018, 19:49:11 UTC - in response to Message 1965162.  
Last modified: 15 Nov 2018, 19:56:26 UTC

...The concept that reducing CPU usage to 90% frees up a core is wrong. The only thing you have done is reduced the number of threads that are processing the same amount of work. That "free" thread isn't going to be used by the GPUs. Because you specifically told BOINC that it isn't allowed to use the 10%. So the GPUs are going to be stealing cycles from the other threads. If you want the GPU to have a unused thread, it has to be able to use any non used thread.

OK, explain how my CPU usage averages 50% usage for feeding the GPUs when the Multiprocessor setting is at 10%.
No CPU tasks running, 11 GPU tasks are running, % of CPU is set at 10% yet it's using 50% and my GPU times are unchanged.
It certainly appears the GPUs are using what they need, Not just the 10% in the CPU setting. The GPUs will use what they need, if available. If Not available, they will slow down for lack of CPU resources. The % CPU setting does nothing to control how much CPU the GPU App uses, that % CPU setting only controls the percent the CPU Apps can use.
ID: 1965403 · Report as offensive
rob smith Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer moderator
Volunteer tester

Send message
Joined: 7 Mar 03
Posts: 22202
Credit: 416,307,556
RAC: 380
United Kingdom
Message 1965413 - Posted: 15 Nov 2018, 20:17:58 UTC

I assume you are asking about the GUI "use at most x% of the CPUs" option.
If so, then it's a very simple answer - this value only applies to CPUs dedicated to processing by a CPU application and does not take into account any CPU usage called for by a GPU. I know it can be a bit confusing, but BOINC has no control over what CPU usage a GPU demands.
Bob Smith
Member of Seti PIPPS (Pluto is a Planet Protest Society)
Somewhere in the (un)known Universe?
ID: 1965413 · Report as offensive
TBar
Volunteer tester

Send message
Joined: 22 May 99
Posts: 5204
Credit: 840,779,836
RAC: 2,768
United States
Message 1965416 - Posted: 15 Nov 2018, 20:23:43 UTC - in response to Message 1965399.  

...Right now I see my cpu utilization running at 57%. I see 8 cores out of 16 idling around 10-25% while 8 cores are pegged at 100%. That is the way I want my hosts to run. Cpu tasks pegged to a physical core and running flat out and the others loafing along supporting my desktop browsing and feeding my gpus.
That is Not the way modern Systems are designed. The OS deliberately spreads the work across all available cores. That is the way the developers meant modern Systems to run. If you think the Developers are wrong, then continue on with what you are doing. Right now my system shows all cores running about the same with normal variance. I think I will let it run the way the Developers programed it.
ID: 1965416 · Report as offensive
1 · 2 · 3 · 4 · Next

Message boards : Number crunching : Should I leave cores or threads free for GPU?


 
©2024 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.