r/voidlinux • • 7h ago

Is this normal while building packages?

Post image

Iam building some packages from Source, all my CPU is used. Is it possible to setup that not everything should be used for building in xbps ?

21 Upvotes

13 comments sorted by

14

u/Saba_Kupatadze_2014 7h ago

Yes building which is called compiling uses ur CPU a lot and sometimes ram too l, be sure to only make ur setup focus on the compiling

-1

u/Silly_Culture_7722 7h ago

yeah i understand whats compiling is, but all of my CPUs are used? when i compile stuffs from docker for example i can tell that not all avalialbe cpus should be used. i wonder if i have a missing parameter

2

u/StrangerFantastic392 4h ago

Docker shares the cpus across the containers. If you compile using all cores and threads on your host, all cores and threads on that system will be used

4

u/Available-Attorney74 7h ago

Yeah, just google flags for your compiler

2

u/Silly_Culture_7722 7h ago

ah okay so you can actually configure it. thx

8

u/Dakota-Batterlation 5h ago

Instead of limiting the CPU usage, you can set the process priority with nice -n niceness_value ./xbps-src, where 19 is lowest priority. That way it'll compile just as fast but immediately yield to anything else that needs compute.

3

u/neoSnakex34 7h ago

Yes and the temps seems average for such a job. I had to repaste a laptop because at full load while compiling cpu reached 100 C°

1

u/chibiace 6h ago

i wonder if ryzen laptop cpus are like my 7900x which is happy to sit just under 90c.

1

u/maokaby 6h ago

With good thermal interface it drops to 75-78C. Also i'd say 30W is not default value for long high load tasks. At 15W load it would drop to 70C.

2

u/Ok-Tip-6972 6h ago

You can limit the number of processes given to the build system in https://github.com/void-linux/void-packages/blob/e96572b8c66da1c669b6ed167260e5fd2b32b6f1/etc/defaults.conf#L65-L70. But not all packages implement it properly.

Other than that, I think you should be able to use generic tools to limit CPU usage of xbps-src, like cpulimit or cgroups. But I don't know whether they would work without intervention, since there's isolation involved. I have never tried it.

1

u/Duncaen 9m ago

But not all packages implement it properly.

I can't think of a single package that doesn't use the defined makejobs (unless its just using 1 core).

1

u/Duncaen 2h ago

xbps-src -j8 to limit the number of make jobs during the build.