Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix threadsPerCore check for Zen 2 (AMD) #149

Merged

Conversation

maksimio
Copy link
Contributor

@maksimio maksimio commented Oct 26, 2024

Hello @klauspost, thanks for the library! I tried running it on my CPU Ryzen 5 4500u (Zen2) and found that the number of threads per core (2) and physical cores (3) were incorrect and the HTT option was also detected incorrectly. In fact this cpu has 1 thread per core and 6 physical (and logical) cores

I wrote a fix using the PPR for AMD Family 17h Models 00h-0Fh Processors (page 82)

изображение

You can find CPUID dump of Ryzen 5 4500u here

Copy link
Owner

@klauspost klauspost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find! While unlikely to ever be hit, I'd propose this as a conservative approach.

Something VM's can be a bit finicky and filter CPUID values.

cpuid.go Outdated Show resolved Hide resolved
@maksimio maksimio force-pushed the feat/correct-amd-zen2-htt-detection branch from ec3f5cb to f02c4cd Compare October 26, 2024 19:54
@maksimio maksimio force-pushed the feat/correct-amd-zen2-htt-detection branch from f02c4cd to 27e993c Compare October 26, 2024 19:57
@klauspost klauspost merged commit ee7cba9 into klauspost:master Oct 26, 2024
10 checks passed
@maksimio maksimio deleted the feat/correct-amd-zen2-htt-detection branch October 26, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants