POV-Ray : Newsgroups : povray.off-topic : Linux guru question Server Time
23 Dec 2024 22:13:47 EST (-0500)
  Linux guru question (Message 1 to 5 of 5)  
From: Anthony D  Baye
Subject: Linux guru question
Date: 31 Aug 2015 18:10:00
Message: <web.55e4d02ad32dd1712aaea5cb0@news.povray.org>
In linux the default priority for any given user-initiated process is 0.  Which
means that when I run povray, its cpu priority is dead last.  I've gotten in the
habit of running sudo top alongside so that I can renice the process to -20, but
this only affects the main thread as far as I can tell.  All child threads have
a priority of 0.

Is there a way to configure linux so that povray and all of its child threads
are given top priority?

Regards,
A.D.B.


Post a reply to this message

From: Le Forgeron
Subject: Re: Linux guru question
Date: 31 Aug 2015 18:29:25
Message: <55e4d545@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Le 01/09/2015 00:07, Anthony D. Baye a écrit :
> In linux the default priority for any given user-initiated process
> is 0.  Which means that when I run povray, its cpu priority is dead
> last.  I've gotten in the habit of running sudo top alongside so
> that I can renice the process to -20, but this only affects the
> main thread as far as I can tell.  All child threads have a
> priority of 0.
> 
> Is there a way to configure linux so that povray and all of its
> child threads are given top priority?
> 
> Regards, A.D.B.
> 

Nah... you are changing the nice value, not the priority nor the
scheduler.

You might want to investigate the 'chrt' command (kind of works like
'nice' and 'taskset' (not 'renice'), a naughty prefix for your
command). Beware, choosing a bad scheduler will froze your system
(especially if you start needing some I/O or swap). povray seems ok to
be a batch instead of default. do not choose real time.

Let me get it straight: DANGER, WILL ROBINSON, DANGER.


You do not want to change the priority. The nice value can be adjusted
ok if you are ready for it.

have a look at:

http://serverfault.com/questions/267496/renice-how-to-change-all-threads

You can also change the governor (default to "ondemand" on Ubuntu and
probably other distributions), for "performance" (CPU at max frequency
all the time): by not computing a possible adjustment due to the load,
you might gain a few cycles at each switch of threads. Just check your
cooling system first.

changing the governor is best done with cpufreq-set, you have to
repeat the command for each pseudo-core.

(sudo cpufreq-set -c 0 -g performance)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iJwEAQEIAAYFAlXk1UQACgkQhKAm8mTpkW20qAP+OPf1T6M93gBaCiVgv7EpkuJ5
yUGRl0FbDo66/3oaM1PN4X57+l71795uzuUrzoH17Py9reIQjnpe5ycNecAAdp7s
rHsEng0EA1bepPvxuauFosAkDqmQLk5u0IhbU/Z+NGwXhMBlhJxg+OAT+WwyrQB3
/OW699DxNjgVlPviTjk=
=lBer
-----END PGP SIGNATURE-----


Post a reply to this message

From: Ger
Subject: Re: Linux guru question
Date: 31 Aug 2015 21:49:40
Message: <55e50434$1@news.povray.org>
Anthony D. Baye wrote:

> In linux the default priority for any given user-initiated process is 0. 
> Which
> means that when I run povray, its cpu priority is dead last.  I've gotten
> in the habit of running sudo top alongside so that I can renice the process
> to -20, but
> this only affects the main thread as far as I can tell.  All child threads
> have a priority of 0.
> 
> Is there a way to configure linux so that povray and all of its child
> threads are given top priority?
> 
> Regards,
> A.D.B.

I've never had to change the nice-ness of any povray run. When the machine is 
just running povray it runs at 800% (or very close to it). When I do 
something else (like start FF) then that program will get some attention from 
some cores but those return to povray as soon as the new program is on 
screen.
I'm running Povray on AMD FX-8 (8 cores) with 16GB.
-- 

Ger


Post a reply to this message

From: Warp
Subject: Re: Linux guru question
Date: 3 Sep 2015 06:01:22
Message: <55e81a72@news.povray.org>
Anthony D. Baye <Sha### [at] spamnomorehotmailcom> wrote:
> In linux the default priority for any given user-initiated process is 0.  Which
> means that when I run povray, its cpu priority is dead last.  I've gotten in the
> habit of running sudo top alongside so that I can renice the process to -20, but
> this only affects the main thread as far as I can tell.  All child threads have
> a priority of 0.

> Is there a way to configure linux so that povray and all of its child threads
> are given top priority?

Unless you have something CPU-heavy running at the same time, it won't
make any difference. Even if you ran it at nice 20 it probably won't
make any difference (unless you run something else that's CPU-heavy
at the same time).

-- 
                                                          - Warp


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: Linux guru question
Date: 18 Sep 2015 13:20:14
Message: <55fc47ce$1@news.povray.org>
On 31/08/2015 11:07 PM, Anthony D. Baye wrote:
> In linux the default priority for any given user-initiated process is 0.  Which
> means that when I run povray, its cpu priority is dead last.

Well... no, no it doesn't. It's still higher priority than anything 
running at priority 1, or priority 2, or priority 3...

Linux priorities run form -20 (the *highest* possible priority) to +19 
(the *lowest* priority). Yes, they're numbered that way around. Yes, 
it's a bit confusing.

> I've gotten in the
> habit of running sudo top alongside so that I can renice the process to -20, but
> this only affects the main thread as far as I can tell.  All child threads have
> a priority of 0.
>
> Is there a way to configure linux so that povray and all of its child threads
> are given top priority?

It probably won't make any difference.

The process priority is *not* "the percentage of the CPU power that you 
get". It doesn't work like that. Rather, the highest-priority task gets 
to use the CPU "first". If it doesn't use all available power, then the 
next task gets a turn, and so on.

If there is only 1 task on the entire system that's actually trying to 
do anything, it will always get 100% of the available CPU. This happens 
utterly regardless of its priority. Priorities only matter if *several* 
tasks are trying to use the CPU at once. In that case, the 
highest-priority task "wins". (The highest priority task can use as much 
CPU as it wants. The second task gets whatever is left over.)

Priority is *not* the percentage of CPU you get. It's about who gets 
first dibs. If only 1 task wants CPU, it can use *all* of it.

Of course, if you *are* trying to do other things as well as POV-Ray... 
well, it depends how compute-intensive it is. But I'm not aware of any 
way of sitting the priority for all child threads. (I'm not even sure if 
priority is per-thread or per-task on Linux...) The best I can come up 
with is looping over the PIDs to renice each one, using some kind of 
shell script. But, again, it's probably pointless.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.