Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
set 'march' thing, amd 8 core
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
while true
Guru
Guru


Joined: 07 Apr 2010
Posts: 532
Location: Ljubljana, Slovenia

PostPosted: Tue Jan 22, 2013 7:09 pm    Post subject: set 'march' thing, amd 8 core Reply with quote

oi


I have new pc box and I have already gentoo running.

I am interested in those cflags
(mind you, I have no idea what this is for, I am everlasting noob)
as it is now:
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"

I have: AMD FX(tm)-8350 Eight-Core Processor
Is my cflag ok, or could I make it better,
namely march thingy, I was not sure what to put in...

or am I being noob and '-march=native' is quite all right?

Thank you
_________________
Kind regards, Goran Mitic

alive
while true
kick ass
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Tue Jan 22, 2013 10:03 pm    Post subject: Reply with quote

while true,

-march=native asks gcc to work out whats best for the CPU its running on.
You must not use -march=native if you want to use distcc. If you don't know what distcc is you are not using it.
Its a bit ugly but you can run
Code:
echo 'int main(){return 0;}' > test.c && gcc -v -Q -march=native -O2 test.c -o test && rm test.c test
to see what -march=native means for you.
The interesting part of the output is
Code:
options passed:  -v test.c -march=amdfam10 -mcx16 -msahf -mno-movbe
 -mno-aes -mno-pclmul -mpopcnt -mabm -mno-lwp -mno-fma -mno-fma4 -mno-xop
 -mno-bmi -mno-tbm -mno-avx -mno-sse4.2 -mno-sse4.1
 --param l1-cache-size=64 --param l1-cache-line-size=64
 --param l2-cache-size=512 -mtune=amdfam10 -O2

on my Phenom II. Yes, I could put all that in place of -march=native but most readers would think I was a ricer.

Post the output of
Code:
emerge --info
if you would like your setup looked over.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
while true
Guru
Guru


Joined: 07 Apr 2010
Posts: 532
Location: Ljubljana, Slovenia

PostPosted: Tue Jan 22, 2013 10:19 pm    Post subject: Reply with quote

hello again NeddySeagoon,
Code:
kishta grom # emerge --info
Portage 2.1.11.31 (default/linux/amd64/10.0/desktop, gcc-4.6.3, glibc-2.15-r3, 3.6.11-gentoo x86_64)
=================================================================
System uname: Linux-3.6.11-gentoo-x86_64-AMD_FX-tm-8350_Eight-Core_Processor-with-gentoo-2.1
Timestamp of tree: Tue, 22 Jan 2013 12:45:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p37
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo x11 sunrise betagarden
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE radeon-ucode freedist"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=4 --load-average=8.0 --autounmask=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.inode.at/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/x11 /var/lib/layman/sunrise /var/lib/layman/betagarden"
SYNC="rsync://rsync1.at.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 apache2 automount berkdb bindist bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gimp gpm gtk iconv ipv6 jpeg lcms ldap libnotify mad mmx mng modules mp3 mp4 mpeg mplayer mudflap multilib mysql ncurses nls nptl ogg ogv opengl openmp pam pango pcre pdf php png policykit ppds qt3support readline scanner sdl session spell sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xml xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en uk us si sr" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

kishta grom #




it is kind of late over here, I must go to bed since I have to wake up early,
and I will read thorougly your post in the morning.

Thank you
_________________
Kind regards, Goran Mitic

alive
while true
kick ass
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Tue Jan 22, 2013 11:04 pm    Post subject: Reply with quote

Hey while true, I like your sig, but may I point out that with a only little more work, you can keep on ass-kicking after you're dead - fork and daemonize.
Back to top
View user's profile Send private message
while true
Guru
Guru


Joined: 07 Apr 2010
Posts: 532
Location: Ljubljana, Slovenia

PostPosted: Wed Jan 23, 2013 8:05 am    Post subject: Reply with quote

hello guys


Seagoon,

aha ok, I found that part:
Code:
options passed:  -v test.c -march=bdver1 -mcx16 -msahf -mno-movbe -maes
 -mpclmul -mpopcnt -mabm -mlwp -mfma -mfma4 -mxop -mno-bmi -mtbm -mavx
 -msse4.2 -msse4.1 --param l1-cache-size=16 --param l1-cache-line-size=64
 --param l2-cache-size=2048 -mtune=bdver1 -O2

so I gather I could put -march=bdver1 in?

Thank you



kimmie,

kheh, thank you. I was always interested to see what is going on behind the scene,
it is still keeping me in trouble, kheh, but if that was not the case I would not have gentoo...
(well, if weren't for YOU guys, I would not have gentoo, but I guess you see what I am aiming for)

so, fork and daemonize, ha?
kick-ass -rf nohup &&
did I get this right?
_________________
Kind regards, Goran Mitic

alive
while true
kick ass
Back to top
View user's profile Send private message
kimmie
Guru
Guru


Joined: 08 Sep 2004
Posts: 531
Location: Australia

PostPosted: Wed Jan 23, 2013 8:50 am    Post subject: Reply with quote

That'll do! Keep on kicking! :)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54096
Location: 56N 3W

PostPosted: Wed Jan 23, 2013 7:32 pm    Post subject: Reply with quote

while true,

Your emerge --info looks good.

There is often a latency problem with gcc and -march=native. The is cause by the time between CPU releases and the changes to gcc so that -march=native works correctly.
-march=bdver1 is for AMD CPUs without the 3DNow and 3Dnowext in their /proc/cpuinfo flags entries.

Check that and yes, you could use
Code:
-march=bdver1
I don't know if that would drop any of the other settings though.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
blain3
n00b
n00b


Joined: 02 Dec 2012
Posts: 30
Location: Southern Pensylvania

PostPosted: Thu Jan 24, 2013 1:37 am    Post subject: Reply with quote

I was also curious about this and was about to install xorg / nvidia drivers and a few other random things, and set the flag before and ~300 packages were torn through in about the same time as usual, maybe even a bit faster but nothing major so I would say if its working and your not compiling for other arch's your fine. At least my opinion anyhow, with 8 cores just make sure to set your MAKEOPTS="-j9" or so (I'm really not clear how this variable works as I've used it set at anywhere from 2 to 19 and have yet to see anything major) and compile in tmpfs (this made the most impact with my system) is what i do. I'm using a 3rd gen i7 though, not an AMD so perhaps it's different.
_________________
#uname -s -m -i -p -v -o -n
Linux
x86_64
GenuineIntel
Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
#1 SMP PREEMPT Mon Nov 19 11:17:39 UTC 2012
GNU/Linux
xobtihs
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