Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
optimal CPU_FLAGS_X86 settings, and, does it even matter?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
ohum
n00b
n00b


Joined: 28 Nov 2017
Posts: 1

PostPosted: Tue Nov 28, 2017 4:42 am    Post subject: optimal CPU_FLAGS_X86 settings, and, does it even matter? Reply with quote

[Moderator note: this was originally a thread necromancy response to Cpu_flags_x86 from 2015, but there was no reason to attach it to that thread. I split it and all then-present responses to this thread. -Hu]

I'm planning to use
Code:
CPU_FLAGS_X86="aes apic avx mmx mmxext pae pclmul popcnt smp sse sse2 sse3 sse4_1 sse4_2 ssse3 xop"

my /proc/cpuinfo is
Code:
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts


Thoughts? Does this even matter?
If I'm correct in understanding, this sets the defaults, which can be overridden.
What is the recommended way to deal with CPU_FLAGS_X86?

Thanks! :)
_________________

  • Blue
  • Yellow
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31388
Location: here

PostPosted: Tue Nov 28, 2017 6:51 am    Post subject: Re: optimal CPU_FLAGS_X86 settings, and, does it even matter Reply with quote

ohum wrote:
What is the recommended way to deal with CPU_FLAGS_X86?

You can use app-portage/cpuid2cpuflags program for set correct CPU_FLAGS_X86
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Tue Nov 28, 2017 2:17 pm    Post subject: Reply with quote

Code:
cpuid2cpuflags | sed 's/: /="/;s/$/"/' >> /etc/portage/make.conf

why cpuid2cpuflags doesn't just output it to be use as-is?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31388
Location: here

PostPosted: Tue Nov 28, 2017 2:24 pm    Post subject: Reply with quote

krinn wrote:
Code:
cpuid2cpuflags | sed 's/: /="/;s/$/"/' >> /etc/portage/make.conf

why cpuid2cpuflags doesn't just output it to be use as-is?

What's wrong?
Code:
$ cpuinfo2cpuflags-x86
CPU_FLAGS_X86="aes avx mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Tue Nov 28, 2017 4:52 pm    Post subject: Reply with quote

must have an old version :)
Code:
cpuid2cpuflags
CPU_FLAGS_X86: aes avx avx2 f16c fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3


ah well
Code:
equery b cpuid2cpuflags
 * Searching for cpuid2cpuflags ...
app-portage/cpuid2cpuflags-4 (/usr/bin/cpuid2cpuflags)

where did you get that cpuinfo2cpuflags-x86 from?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31388
Location: here

PostPosted: Tue Nov 28, 2017 6:19 pm    Post subject: Reply with quote

krinn wrote:
where did you get that cpuinfo2cpuflags-x86 from?

Code:
$ equery b cpuinfo2cpuflags-x86
 * Searching for cpuinfo2cpuflags-x86 ...
app-portage/cpuid2cpuflags-1 (/usr/lib/python-exec/python3.4/cpuinfo2cpuflags-x86)
app-portage/cpuid2cpuflags-1 (/usr/lib/python-exec/python2.7/cpuinfo2cpuflags-x86)
app-portage/cpuid2cpuflags-1 (/usr/bin/cpuinfo2cpuflags-x86 -> ../lib/python-exec/python-exec2)

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Wed Nov 29, 2017 1:19 am    Post subject: Reply with quote

It confirm older is better :D
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31388
Location: here

PostPosted: Wed Nov 29, 2017 7:03 am    Post subject: Reply with quote

krinn wrote:
It confirm older is better :D

Old is always better :wink: :P
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6656
Location: The soundosphere

PostPosted: Tue Feb 06, 2018 4:30 pm    Post subject: Reply with quote

Why did the output format change? I've had to mask version 5, it's less helpful.
_________________
decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN
Back to top
View user's profile Send private message
The_Great_Sephiroth
Veteran
Veteran


Joined: 03 Oct 2014
Posts: 1602
Location: Fayetteville, NC, USA

PostPosted: Tue Feb 06, 2018 5:22 pm    Post subject: Reply with quote

So I am trying to follow this, but what is the difference here. I have always used cpuinfo2cpuflags as we were instructed to do so when the CPU_FLAGS_X86 was added.
_________________
Ever picture systemd as what runs "The Borg"?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31388
Location: here

PostPosted: Tue Feb 06, 2018 5:42 pm    Post subject: Reply with quote

audiodef wrote:
Why did the output format change? I've had to mask version 5, it's less helpful.

Because now hint for activate is
Code:
                        elog 'Please note that the output has changed in v2. The new format is suitable'
                        elog 'both for Portage and Paludis. To use it, e.g.:'
                        elog
                        elog '  $ echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use/00cpuflags'
                        elog
                        elog '(you may need to convert package.use into a directory if you want to use'
                        elog ' separate file as presented here)'


I don't like this solution and I continue to use CPU_FLAGS_X86 in make.conf, but
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Feb 06, 2018 6:49 pm    Post subject: Reply with quote

ohum,

CPU_FLAGS_X86 settings, and, does it even matter

The first part of your question has been addressed above.

The second part, does it matter seems to have got lost.
It matters to the few applications that have hand optimised code segments that are selected at build time.
If you want a list of those ebuilds, run
Code:
qgrep -l -i CPU_FLAGS_X86

qgrep belongs to app-portage/portage-utils.

If you use any of those applications, you we get performance improvements with correctly set CPU_FLAGS_X86.

Even that is a little simplistic as not all packages offer all CPU_FLAGS_X86 and not all processors offer all CPU_FLAGS_X86.
Looking at sys-fs/dd-rescue, it offers cpu_flags_x86_avx2 and cpu_flags_x86_sse4_2 so if your CPU does not have them, dd-rescue won't benefit.
_________________
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
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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