View previous topic :: View next topic |
Author |
Message |
XelKarin Tux's lil' helper
Joined: 29 Dec 2003 Posts: 85
|
Posted: Sun Apr 21, 2024 11:37 pm Post subject: CPU has conflicting L1 cache size depending on core |
|
|
I have a laptop with a 12th Gen Intel(R) Core(TM) i7-1260P CPU. Recently, while upgrading to Gentoo profile 23.0 I received an error telling me to use the app-misc/resolve-march-native package to resolve GCC optimization parameters due to conflicting cache size optimizations. Using that and the taskset command, I've determined that the first 8 processor cores use an L1 cache size of 48, and the back 8 cores use an L1 cache size of 32. I was wondering which of these values would be the most optimal to use to resolve the conflict.
I suppose it might depend on whether I choose to optimize for performance or power efficiency? |
|
Back to top |
|
|
user Apprentice
Joined: 08 Feb 2004 Posts: 209
|
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 4876 Location: Bavaria
|
Posted: Mon Apr 22, 2024 11:34 am Post subject: |
|
|
Do you have soemthing like this in your make.conf ?
Code: | COMMON_FLAGS="-march=native -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}" |
If yes, then try to change it to your 12.gen CPU:
Code: | COMMON_FLAGS="-march=alderlake -O2 -pipe" |
Does this help ? _________________ https://wiki.gentoo.org/wiki/User:Pietinger |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22435
|
Posted: Mon Apr 22, 2024 3:02 pm Post subject: |
|
|
Using either choice should eliminate the error with gcc. Yes, ideally you would pick which one corresponds to your usage pattern. If in doubt, take a guess. Both should work, and if you pick wrong, the only consequence should be that you encourage gcc to generate code that runs slightly less well due to it planning for the wrong L1 cache size. I would not expect the generated code to produce the wrong results, only to be larger/smaller than optimal, and somewhat slower. Outside of very CPU-intensive applications, I doubt you will notice the difference. |
|
Back to top |
|
|
XelKarin Tux's lil' helper
Joined: 29 Dec 2003 Posts: 85
|
Posted: Mon Apr 22, 2024 9:17 pm Post subject: |
|
|
pietinger wrote: | Do you have soemthing like this in your make.conf ? |
I received the following error when attempting to compile sys-devel/gcc under profile 23.0. app-misc/resolve-march-native gave me a list of alternative CFLAGS to use in lieu of -march=native. Although running it multiple times it would alternate between --param=l1-cache-size=32 and --param=l1-cache-size=48.
Code: | Different values of l1-cache-size detected!
GCC will fail to bootstrap when comparing files with these flags.
This CPU is likely big.little/hybrid hardware with power/efficiency cores.
Please install app-misc/resolve-march-native and run 'resolve-march-native'
to find a safe value of CFLAGS for this CPU. Note that this may vary
depending on the core it ran on. taskset can be used to fix the cores used. |
Hu wrote: | Using either choice should eliminate the error with gcc. Yes, ideally you would pick which one corresponds to your usage pattern. If in doubt, take a guess. Both should work, and if you pick wrong, the only consequence should be that you encourage gcc to generate code that runs slightly less well due to it planning for the wrong L1 cache size. I would not expect the generated code to produce the wrong results, only to be larger/smaller than optimal, and somewhat slower. Outside of very CPU-intensive applications, I doubt you will notice the difference. |
I've decided to go with --param=l1-cache-size=32. I assume it might help improve battery life. |
|
Back to top |
|
|
|