View previous topic :: View next topic |
Author |
Message |
lcsavb n00b
Joined: 11 Jun 2020 Posts: 51 Location: Bayern / Deutschland
|
Posted: Sun Nov 03, 2024 11:29 am Post subject: local binhost |
|
|
Hey!
I would like to use my Dektop with arch Linux and a Threadripper processor to compile packages for my laptop with gentoo and meteor lake.
? I read that binhost is easier than gccdist, right? the march=meteor lake been implemented?
I have to install portage in my arch desktop?
Can I install gentoo using my local binhost ?
We I have used gentoo 5 years ago and I miss it. Glad I am coming back. I have used Gentoo for a couple of years in my 8th gen intel laptop, I thought about doing that because back then it took me 6 hours to compile all the stuff to install Gentoo, so I thought about this solution to make installation/updates faster.
Thanks |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54578 Location: 56N 3W
|
Posted: Sun Nov 03, 2024 11:42 am Post subject: |
|
|
There is a wiki page about building in a chroot.
Essentially, you make a chroot on your threadripper that is a copy of the install you want on the laptop.
The devil is in the detail and you have one AMD and one Intel CPU.
see the wiki page. I would post a link but I'm on my phone just now. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
lcsavb n00b
Joined: 11 Jun 2020 Posts: 51 Location: Bayern / Deutschland
|
Posted: Sun Nov 03, 2024 12:00 pm Post subject: |
|
|
But having a Ryzen in my desktop and an Intel in my laptop would make a difference If I choose the right march? |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22695
|
Posted: Sun Nov 03, 2024 2:03 pm Post subject: |
|
|
The processor mismatch requires you to be more careful with your -march, but a properly chosen value should still work. You need a value that generates code that runs on both the AMD and Intel CPUs. This is well supported, as the binary distributions offer a single download that works for both. They pay for it in the inability to use processor-specific extensions. |
|
Back to top |
|
|
Ralphred l33t
Joined: 31 Dec 2013 Posts: 656
|
Posted: Sun Nov 03, 2024 5:03 pm Post subject: |
|
|
Hu wrote: | The processor mismatch requires you to be more careful with your -march | If we extract/dissect the "-march=native" flags* from each machine, ignore all the -mno<option>s, and craft a COMMON_FLAGS= just composed of the -m<option>s that exists for both CPU's, suffixed with a -mtune=meteorlake, my understanding is that will produce binaries capable of running on both CPU's but optimised for the laptop?
If I do it with for my znver3 and skylake laptop I end up with Code: | #skylake
-mmmx -mpopcnt -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -mfma -mbmi -mbmi2 -maes -mpclmul -madx -mabm -mclflushopt -mcx16 -mf16c -mfsgsbase -mfxsr -msahf -mlzcnt -mmovbe -mprfchw -mrdrnd -mrdseed -msgx -mxsave -mxsavec -mxsaveopt -mxsaves
#znver3
-mmmx -mpopcnt -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -msse4a -mfma -mbmi -mbmi2 -maes -mpclmul -mvpclmulqdq -madx -mabm -mclflushopt -mclwb -mclzero -mcx16 -mf16c -mfsgsbase -mfxsr -msahf -mlzcnt -mmovbe -mmwaitx -mpku -mprfchw -mrdpid -mrdrnd -mrdseed -msha -mshstk -mvaes -mwbnoinvd -mxsave -mxsavec -mxsaveopt -mxsaves
#AND combined
COMMON_FLAGS="-mmmx -mpopcnt -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -mfma -mbmi -mbmi2 -maes -mpclmul -madx -mabm -mclflushopt -mcx16 -mf16c -mfsgsbase -mfxsr -msahf -mlzcnt -mmovbe -mprfchw -mrdrnd -mrdseed -mxsave -mxsavec -mxsaveopt -mxsaves -mtune=skylake" | Is this correct or have I got the wrong end of the stick?
*I used gcc -### -march=native -x c - 2>&1|sed -r '/cc1/!d;s/^.* - "-march=[a-z0-9]*"| -mno-[0-9a-z-]*|--param.*//g' but there are other ways. |
|
Back to top |
|
|
lcsavb n00b
Joined: 11 Jun 2020 Posts: 51 Location: Bayern / Deutschland
|
Posted: Sun Nov 03, 2024 7:36 pm Post subject: |
|
|
I asked chatGPT:
" Yes, that's correct. Compiling directly on the target machine typically allows for better optimization because the compiler can take full advantage of the specific architecture and features available on that hardware. Here are some reasons why:
Architecture-Specific Optimizations: The compiler can generate code that leverages the unique capabilities of the target CPU (like specific instruction sets or optimizations).
Performance Tuning: You can fine-tune the build configuration for the target environment, considering factors like cache sizes and memory architecture.
Dependencies: When compiling on the target machine, you ensure that all libraries and dependencies are specifically tailored for that architecture.
Avoiding Compatibility Issues: Compiling on the target helps mitigate potential issues with compatibility between different architectures, such as binary incompatibilities.
If optimal performance is a priority for your application, compiling directly on the Meteor Lake system is the best approach. However, if you're constrained to building on the Threadripper, just be cautious with the flags and dependencies to maximize compatibility."
I will compile everything in my laptop, otherwise I would lose one of the main factors I use Gentoo: extracting all the performance possible.
At the end, it' s about 5%, but it is my fetish. |
|
Back to top |
|
|
Ralphred l33t
Joined: 31 Dec 2013 Posts: 656
|
Posted: Mon Nov 04, 2024 12:52 am Post subject: |
|
|
lcsavb wrote: | I will compile everything in my laptop, otherwise I would lose one of the main factors I use Gentoo: extracting all the performance possible.
At the end, it' s about 5%, but it is my fetish. | You can still use distcc (running in a gentoo chroot) to farm the compiling out to your desktop, and your desktop will create "laptop specific binaries" this way.
https://github.com/KSmanis/docker-gentoo-distcc looks promising too? (well beats maintaining your own chroot IMHO) |
|
Back to top |
|
|
lcsavb n00b
Joined: 11 Jun 2020 Posts: 51 Location: Bayern / Deutschland
|
Posted: Mon Nov 04, 2024 6:09 am Post subject: |
|
|
That’s a great project. Thanks for sharing.
It wouldn’t change the fact processors are discrepant, yet I could sign up for some in the cloud. |
|
Back to top |
|
|
Ralphred l33t
Joined: 31 Dec 2013 Posts: 656
|
Posted: Mon Nov 04, 2024 1:30 pm Post subject: |
|
|
lcsavb wrote: | It wouldn’t change the fact processors are discrepant | It doesn't matter: gcc can produce binaries that can't be run on the machine running gcc, I know I'm not the only person here that compiles binaries for their RaspberryPi or other arm based computer on their x86 desktop or server.
The only reason people are suggesting you not run a cpu specific binhost and to produce binaries compatible with both cpu's is the level of complexity involved in doing it in a chroot in arch. To be honest most gentoo users will just choose to use distcc because a full binhost for a specific cpu requires an almost full replica of the the target system existing on the build pc and in the "target only compatible" chroot. For you that would mean a chroot running gentoo that has nearly all the packages of your laptop, hosting a chroot that does have all the packages of your laptop - this wouldn't be very costly in space and maintenance time. It's totally possible with tools like sys-devel/crossdev, just not very practical.
The docker distcc image is the complete opposite, it's maintained by someone else, will require no maintenance beyond keeping docker working inside arch, and allows you to utilise the core count of your ryzen to do the heavy lifting without losing cpu specific optimisations - don't trust chatGPT on this unless it's only been trained on documents exclusively written by people who cross-compile (a very VERY small percentage of people do it, let alone document it themselves).
Meteor lake support was added as -march=meteorlake and -mtune=meteorlake in ggc-13. A quick look at the gcc source shows it as alderlake with 1 extra extension. |
|
Back to top |
|
|
lcsavb n00b
Joined: 11 Jun 2020 Posts: 51 Location: Bayern / Deutschland
|
Posted: Mon Nov 04, 2024 5:56 pm Post subject: |
|
|
Thanks Ralphred for clarifying.
I will use this container. |
|
Back to top |
|
|
|