Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
safe cflags passen nicht?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
tazinblack
Veteran
Veteran


Joined: 23 Jan 2005
Posts: 1146
Location: Baden / Germany

PostPosted: Fri Nov 25, 2016 7:46 am    Post subject: safe cflags passen nicht? Reply with quote

Hallo zusammen,

kann es sein, dass die cflags, welche hier empfohlen werden https://wiki.gentoo.org/wiki/Safe_CFLAGS#Core_i3.2Fi5.2Fi7_.26_Xeon_E3.2FE5.2FE7_.2AV2
nicht immer zur CPU passen? Ich installiere gerade gentoo in eine VMware VM.
Die CPU ist eine Xeon-E5 2620 V2.

Der Kernel sagt dazu das:
Code:

cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 62
model name      : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
stepping        : 4
microcode       : 0x427
cpu MHz         : 2100.000
cache size      : 15360 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx hypervisor lahf_lm ida arat epb pln pts dtherm
bugs            :
bogomips        : 4200.00
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:


Wenn ich jetzt die cflags setze wie empfohlen:

Code:
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=core-avx2 -O2 -pipe"
CXXFLAGS="${CFLAGS}"


Dann bekomme ich recht schnell undefinierbare compile Fehler und bei emerge Befehlen teilweise schn beim Überprüfen der checksums "ungültiger Maschinenbefehl".

Im dritten Anlauf habe ich jetzt die cflags gelassen, wie sie sind:

Code:
cat /etc/portage/make.conf
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -pipe"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
# These are the USE and USE_EXPAND flags that were used for
# buidling in addition to what is provided by the profile.
USE="bindist"
CPU_FLAGS_X86="mmx sse sse2"
MAKEOPTS="-j2"
PORTDIR="/usr/portage"
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"


Und jetzt lief schon mal der "emerge -DuNav @world" durch.

Hab ich das was falsch verstanden???
_________________
Gruß / Regards
tazinblack
_______________________________________________________
what's the point in being grown up if you can't be childish sometimes
Back to top
View user's profile Send private message
Randy Andy
Veteran
Veteran


Joined: 19 Jun 2007
Posts: 1152
Location: /dev/koelsch

PostPosted: Fri Nov 25, 2016 8:44 am    Post subject: Reply with quote

Allerdings, tazinblack,

denn deine CPU kennt noch keine avx2 instruction set, da sie auf der Sandy Bridge Architektur basiert:
http://www.cpu-world.com/CPUs/Xeon/Intel-Xeon%20E5-2620.html

Avx2 hielt aber erst mit Haswell Einzug: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#AVX2
Dein dritter Anlauf ganz ohne -march Angabe ist natürlich alles andere als Optimal und das Wiki hinkt wie immer etwas hinterher, was aber nicht schlimm ist, denn schließlich enthält es ja die verlässlichere Anleitung wie Du deine CFLAGS selbst ermitteln kannst.
Noch einfacher geht das übrigens mit dem Paket hier:
https://packages.gentoo.org/packages/app-misc/resolve-march-native

Lange Rede kurzer Sinn, wenn Du eine hinreichend aktuellen GCC, also wohl ab 4.9, konkret hab ich gerade mal in die Doku zu 5.4 geschaut, dann verwendest Du etwas in der Art:

Code:
CFLAGS="-march=sandybridge -O2 -pipe"


Und wenn Du einmal dabei bist, pass auch mal deine CPU_FLAGS_X86="" Werte an, dafür gabs auch ein Tool welches in den eselect news list erläutert wurde, sowie zusätzlich
deine MAKEOPTS="-j12" für die neue CPU. ;-)

Gruß und happy compiling.
_________________
If you want to see a Distro done right, compile it yourself!
Back to top
View user's profile Send private message
tazinblack
Veteran
Veteran


Joined: 23 Jan 2005
Posts: 1146
Location: Baden / Germany

PostPosted: Fri Nov 25, 2016 9:41 am    Post subject: Reply with quote

Randy Andy wrote:
Allerdings, tazinblack,

denn deine CPU kennt noch keine avx2 instruction set, da sie auf der Sandy Bridge Architektur basiert:
http://www.cpu-world.com/CPUs/Xeon/Intel-Xeon%20E5-2620.html

Avx2 hielt aber erst mit Haswell Einzug: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#AVX2
Dein dritter Anlauf ganz ohne -march Angabe ist natürlich alles andere als Optimal und das Wiki hinkt wie immer etwas hinterher, was aber nicht schlimm ist, denn schließlich enthält es ja die verlässlichere Anleitung wie Du deine CFLAGS selbst ermitteln kannst.
Noch einfacher geht das übrigens mit dem Paket hier:
https://packages.gentoo.org/packages/app-misc/resolve-march-native

Lange Rede kurzer Sinn, wenn Du eine hinreichend aktuellen GCC, also wohl ab 4.9, konkret hab ich gerade mal in die Doku zu 5.4 geschaut, dann verwendest Du etwas in der Art:

Code:
CFLAGS="-march=sandybridge -O2 -pipe"


Und wenn Du einmal dabei bist, pass auch mal deine CPU_FLAGS_X86="" Werte an, dafür gabs auch ein Tool welches in den eselect news list erläutert wurde, sowie zusätzlich
deine MAKEOPTS="-j12" für die neue CPU. ;-)

Gruß und happy compiling.


Also bisher habe ich mich immer auf das Wiki verlassen können und die CPU ist ja jetzt auch nicht so neu.
Ich habe den Fehler vermerkt auf der entsprechenden "talk page" -> https://wiki.gentoo.org/wiki/Talk:Safe_CFLAGS

Die CPU-Flags habe ich noch nicht gesetzt, weil ich jetzt erst mal grundsätzlich das Problem gelöst haben wollte.
Makeopts auf -j12, macht wenig Sinn wenn die VM nur 4 Kerne hat. Ich werde das wohl auf -j5 stellen.

Da die Kiste eine VM ist und auch auf anderer INTEL Hardware lauffähig sein soll frage ich mich, was hier ideal wäre.
Ein guter Kompromiss wäre wünschenswert zwischen gut optimiert und noch anderweitig lauffähig.

Danke für die Hilfe!

Gruß
tazinblack
_________________
Gruß / Regards
tazinblack
_______________________________________________________
what's the point in being grown up if you can't be childish sometimes
Back to top
View user's profile Send private message
Randy Andy
Veteran
Veteran


Joined: 19 Jun 2007
Posts: 1152
Location: /dev/koelsch

PostPosted: Fri Nov 25, 2016 11:23 am    Post subject: Reply with quote

Gern geschehen, tazinblack.

Das mit der VM hatte ich tatsächlich überlesen, daher die für dein Zielsystem die zu hoch angesetzten j-Werte.

Als Kompromiss deiner CFLAGS Settings zwischen Kompatibilität und Performance, empfehle ich den kleinsten gemeinsamen Nenner der vorhandenen Instruction Sets deiner zu verwendenden CPUs, innerhalb deiner gewählten Architektur.
Vergleiche z.B. hier sandybridge vs. core2 oder nocona: https://gcc.gnu.org/onlinedocs/gcc-5.4.0/gcc/x86-Options.html#x86-Options


Gruß und weiterhin viel Erfolg,
Andy.
_________________
If you want to see a Distro done right, compile it yourself!
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Sat Nov 26, 2016 8:16 pm    Post subject: Reply with quote

Hi,

vorsicht mit den CFLAGS. Der E5-2620v2 ist ein Ivy Bridge EP kein Sandy Bridge. Und ja, der unterstützt noch kein AVX2 nur AVX.

siehe: https://en.wikipedia.org/wiki/List_of_Intel_Xeon_microprocessors#Xeon_E5-26xx_v2_.28dual-processor.29

Daher solltest du dann auf folgende CFLAGS setzen, wie im Wiki auch angegeben: -march=ivybridge -O2 -pipe

siehe: https://wiki.gentoo.org/wiki/Safe_CFLAGS#Core_i3.2Fi5.2Fi7_.26_Xeon_E3.2FE5.2FE7_.2AV2

MfG. Stefan
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
Randy Andy
Veteran
Veteran


Joined: 19 Jun 2007
Posts: 1152
Location: /dev/koelsch

PostPosted: Fri Feb 03, 2017 9:07 am    Post subject: Reply with quote

Hab hier erst jetzt mal wieder reingeschaut,

gut dass es in diesem Fall nur einen marginalen Unterschied der Instruction Sets zwischen Sandy und Ivy Bridge gibt, über die tazinblack hätte stolpern können.

Jedenfalls dank an Stefan fürs Aufpassen und die Richtigstellung, sowie die nützlichen Links zu Wikipedia.

Das Pendant von CPU World dazu, auf die ich oben besser verlinkt hätte wäre dann diese gewesen:
http://www.cpu-world.com/Compare/199/Intel_Xeon_E5-2620_vs_Intel_Xeon_E5-2620_v2.html

Gruß, Andy.
_________________
If you want to see a Distro done right, compile it yourself!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) 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