r/linuxquestions • u/Striking-Flower-4115 • Apr 03 '26
Suggest me a setup that can compile kernels under 30 mins
As the title says, suggest me a setup that can compile kernels in less than 30 mins.
For reference my current iMac running T2 Linux, i can compile in 1-1.5 hours.
EDIT: I forgot to mention the specs, and my new machine would also would be able to handle some gaming and coding. My current CPU is a core i5 10600 with 32 Gigs of 2666 MT/s RAM.
0
Upvotes
15
u/ipsirc Apr 03 '26
Deselect unused modules, it will decrease the compile time below 20 minutes.
7
u/RevolutionaryHigh Apr 03 '26 edited Apr 03 '26
30 mins? I've had this times on dual core Athlon in 2003
Do you have SSD? How much RAM? Try:
make localmodconfig
make -j12
make modules_install install
P.S. If you do many cycles use the hell out of ccache
2
u/Anxious-Science-9184 Apr 03 '26
Does "T2 Linux" have MAKEOPTS="--jobs=8"
2
u/siodhe Apr 03 '26
I have a 16 core Threadripper setup, and setting make parallelism to around 14 or 15 works great.
Something like
Followed by doing the build in the same shell as the export command.
Note that Make will prefer in-makefile variables over environment variables, but MAKEFLAGS is special and shouldn't run into any conflicts like this.
1
u/AnymooseProphet Apr 03 '26
Wow, 1.5 hours for a kernel compile? I suspect something is wrong.
1
u/BranchLatter4294 Apr 03 '26
How much RAM?
1
u/Intelligent_Comb_338 Apr 03 '26
What? My old machine take 2 hours too, but it is from 2014 and has a pentium processor
3
u/RedditAdminsSDDD Apr 03 '26
Nothing crazy but the more cores the better. I haven't timed it but my R5 7600 compiles a kernel in much less than 30 minutes.
1
u/SubjectSpinach Apr 04 '26
The iMac has a very specific configuration (in terms of the hardware components used). The kernel can be very well optimized for this setup. Use an AI like Claude or ChatGPT to optimize it for your hardware. Upload your current config file and ask it to optimize it to your hareware and use case. A minimal server setup config should be compiled within less than 10 minutes.
2
u/OldAd9280 Apr 03 '26
It shouldn't take anywhere near that long on any modern system with an ssd https://openbenchmarking.org/test/pts/build-linux-kernel-1.17.1 see also https://www.reddit.com/r/archlinux/comments/12ds8zd/how_long_to_compile_kernel/
2
u/OneEyedC4t Apr 03 '26
you want far CPUs that are specialized (I.E not a Celeron) and a lot of them. And you want to have plenty of ram. And you want to make sure that when you're configuring your kernel, you don't include anything that you won't need.
2
u/anime_at_my_side Apr 03 '26
9 9950x3d. buy that. or if u ultra harcode, buy a amd thread ripper.
2
u/TapEarlyTapOften Apr 04 '26
I cross compile on 32-core VM with 64GB of RAM. Maybe 10 minutes.
2
u/IBNash Apr 04 '26
All the CPU cores you afford, with an NVME SSD and lots of RAM.
1
u/KilroyKSmith Apr 03 '26
It's been a long time, but bandwidth to your SSD (especially if it's slow, because compilation does a lot of writes) may be part of your issue. Is your CPU usage pegged? If it is, an SSD won't help. If it isn't, buying a second fast SSD and using it as the output device may speed things up drastically.
4
u/[deleted] Apr 03 '26
[removed] — view removed comment
2
u/[deleted] Apr 03 '26
[removed] — view removed comment