Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Using the same Gentoo installation on 5 different PCs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
gorg86
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2011
Posts: 128

PostPosted: Sun Jun 19, 2016 8:24 pm    Post subject: Using the same Gentoo installation on 5 different PCs Reply with quote

Hello,

I have 5 PCs they all have 64bit CPUs. 4 of them use different AMD dual core CPUs and one has an Intel Quad Core (Q6600).
I'd like to use Gentoo on all of those but I don't want to compile the basic system + the desktop environment on all of those seperately.
I want to install the system on the Intel machine (because it has the fastest CPU) and then clone the hard drive to the other 4.

My problem is the CFLAGS (march) variable. How can I determine what should be put in there?
Which parameters are use e.g. for the Gentoo 64bit Live DVD?

thanks
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Sun Jun 19, 2016 11:20 pm    Post subject: Reply with quote

https://gcc.gnu.org/onlinedocs/gcc-4.5.4/gcc/i386-and-x86_002d64-Options.html

I would go with -march=i686. If all the computers were AMD, you could definitely get better performance with -march=k8.

k7 was already a big break from Intel and IIRC, some i686 instructions will fail on a k6. On my k6 installation, I had to find an old i486 tarball.
However, k8's will run fine on a i686 Ubuntu, so it should be OK for all 64-bit x86-64.

If it's not too much trouble to do twice, use -march=native on the Intel and -march=k8 on the fastest AMD and clone that to the other AMD's.

If you can afford the down time, do them all -march=native. Even on a k6, the computer will only grind for three or four days! I recently did a major upgrade on a low memory old k8. It rebuilt about 75% of the packages (including gentoo-sources). it took about 11 hours. I started it at 9:30PM and it was done after breakfast.

Or look into distcc

EDIT:
Available memory is more of a hangup than processor speed, swapping to disk is S-L-O-W
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2574

PostPosted: Sun Jun 19, 2016 11:58 pm    Post subject: Reply with quote

Actually, the setup you are looking for is to set up an nfs share from the intel machine which shares /usr/portage. You also want to enable the build binary option by default on the intel machine and the use binary option on all the amd machines.

The tool to clone the install is rsync. You are best served by copying data, not partitions, and you can do it over your network. I'm not sure if the Gentoo live DVD has the tools you want and it is a bit dated. The system rescue CD is probably better suited to the task at hand.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Mon Jun 20, 2016 11:55 am    Post subject: Reply with quote

There was a way too see what march native translates for a box. You may be able to test this with a linux live-cd without installing anything.
Check all those boxes and than use the minimal common set for that.
also the gcc "handbook" / "documentation" or gentoo wiki may help in this regard.

the 64bit feature is implemented for a while. my first notebook a turion mt-32 from amd had already 64bit support.

You could make a generic gentoo installation but I think you need for each box

see it as my recommendation

each box: its own kernel (because of different hardware)
+ xorg config + gpu drivers + xorg modules
+ grub config (bootloader )

...

When you do not need 32bit box, i would go for amd 64 + 32 bit stuff for the few bits you really need.
Back to top
View user's profile Send private message
gorg86
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2011
Posts: 128

PostPosted: Mon Jun 20, 2016 7:26 pm    Post subject: Reply with quote

Thank you guys, I still have one question though:
According to the distcc wiki it is sufficient to get all the CPU features with the command
Code:
gcc -v -E -x c -march=native -mtune=native - < /dev/null 2>&1 | grep cc1 | perl -pe 's/ -mno-\S+//g; s/^.* - //g;'

Is it really safe to drop all -mno* flags?
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Thu Jun 23, 2016 7:39 pm    Post subject: Reply with quote

Code:
https://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html



Thoughts / example of my box ...

--

Code:
gcc -v -E -x c -march=native -mtune=native - < /dev/null 2>&1 | grep cc1 | perl -pe 's/ -mno-\S+//g; s/^.* - //g;'
-march=ivybridge -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -maes -mpclmul -mpopcnt -mavx -msse4.2 -msse4.1 -mrdrnd -mf16c -mfsgsbase -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=ivybridge -fstack-protector-strong


Code:

roman@ASUS-G75VW ~ $ gcc -v -E -x c -march=native -mtune=native - < /dev/null 2>&1
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/5.3.0/gcc
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/5.3.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.3.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.3.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/5.3.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/5.3.0/python --enable-languages=c,c++,java,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --disable-nls --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 5.3.0 p1.1, pie-0.6.5' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libmudflap --disable-libssp --enable-libcilkrts --disable-libmpx --enable-vtable-verify --enable-libvtv --enable-lto --with-isl --disable-isl-version-check --enable-libsanitizer
Thread model: posix
gcc version 5.3.0 (Gentoo 5.3.0 p1.1, pie-0.6.5)
COLLECT_GCC_OPTIONS='-v' '-E' '-march=native' '-mtune=native'
 /usr/libexec/gcc/x86_64-pc-linux-gnu/5.3.0/cc1 -E -quiet -v - -march=ivybridge -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -maes -mno-sha -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-pcommit -mno-mwaitx --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=ivybridge -fstack-protector-strong
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include-fixed
 /usr/include
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "<stdin>"
COMPILER_PATH=/usr/libexec/gcc/x86_64-pc-linux-gnu/5.3.0/:/usr/libexec/gcc/x86_64-pc-linux-gnu/5.3.0/:/usr/libexec/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-E' '-march=native' '-mtune=native'


--

/usr/libexec/gcc/x86_64-pc-linux-gnu/5.3.0/cc1 -E -quiet -v - -march=ivybridge -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -maes -mno-sha -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-clwb -mno-pcommit -mno-mwaitx --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=ivybridge -fstack-protector-strong

Makes sense to remove

-mno-3dnow .. no support for 3dnow
-mno-sse4a .. no support for sse4a
-mno-fma ... afaik amd instruction, i doubt my cpu has support for that



--

gcc -v -E -x c -march=native -mtune=native - < /dev/null 2>&1 | grep cc1 | perl -pe 's/ -mno-\S+//g; s/^.* - //g;'
-march=ivybridge -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -maes -mpclmul -mpopcnt -mavx -msse4.2 -msse4.1 -mrdrnd -mf16c -mfsgsbase -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=ivybridge -fstack-protector-strong

---

In my personal opinion, IMHO, yes its safe to remove those -mno- flags. I'm quite sure those flags are not supported for my cpu. I think the wiki will be most of the time correct.

Feel free to check your manufacturer homepage for supported features of your cpu. you may also reflect the latest changes to the cpu instruction set by the latest availabe microcode.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5761

PostPosted: Thu Jun 23, 2016 9:02 pm    Post subject: Reply with quote

gorg86 wrote:
Thank you guys, I still have one question though:
According to the distcc wiki it is sufficient to get all the CPU features with the command
Code:
gcc -v -E -x c -march=native -mtune=native - < /dev/null 2>&1 | grep cc1 | perl -pe 's/ -mno-\S+//g; s/^.* - //g;'

Is it really safe to drop all -mno* flags?

I wrote the following script a few years ago which produces almost the same output (no -fstack-protector-strong, but that's on by default):
Code:
echo $(gcc -v -march=native -x c /dev/null 2>&1 \
        | grep -- '-march' \
        | pcregrep -o "(?<=\s)-(?:m|-param )\\S+" \
        | grep -v -- '-mno')

The reason behind removing -mno is that they're redundant; -march acts as a whitelist already and the other -m flags are left in as backup in the event a sloppy filter-flags call in an ebuild removes that.
Back to top
View user's profile Send private message
likewhoa
l33t
l33t


Joined: 04 Oct 2006
Posts: 777
Location: Brooklyn, New York

PostPosted: Sun Jun 26, 2016 1:29 pm    Post subject: Reply with quote

The Doctor wrote:
I'm not sure if the Gentoo live DVD has the tools you want and it is a bit dated. The system rescue CD is probably better suited to the task at hand.


The latest livedvd is dated 20160514 and if there are any missing packages on it, the end user can simply emerge them ;)
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2574

PostPosted: Sun Jun 26, 2016 8:58 pm    Post subject: Reply with quote

likewhoa wrote:
The Doctor wrote:
I'm not sure if the Gentoo live DVD has the tools you want and it is a bit dated. The system rescue CD is probably better suited to the task at hand.


The latest livedvd is dated 20160514 and if there are any missing packages on it, the end user can simply emerge them ;)
I stand corrected. They slipped another one out without me noticing.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum