Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CPU has conflicting L1 cache size depending on core
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
XelKarin
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2003
Posts: 84

PostPosted: Sun Apr 21, 2024 11:37 pm    Post subject: CPU has conflicting L1 cache size depending on core Reply with quote

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
View user's profile Send private message
user
Apprentice
Apprentice


Joined: 08 Feb 2004
Posts: 202

PostPosted: Mon Apr 22, 2024 11:21 am    Post subject: Reply with quote

More background information:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111768

I assume choose cpu-compile flags based by feature-minimal cpu core.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4196
Location: Bavaria

PostPosted: Mon Apr 22, 2024 11:34 am    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21669

PostPosted: Mon Apr 22, 2024 3:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
XelKarin
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2003
Posts: 84

PostPosted: Mon Apr 22, 2024 9:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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