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

kernel version #2

Open
cminnoy opened this issue Apr 6, 2019 · 5 comments
Open

kernel version #2

cminnoy opened this issue Apr 6, 2019 · 5 comments

Comments

@cminnoy
Copy link

cminnoy commented Apr 6, 2019

What kernel version do you need? On 4.15 (Ryzen 1700X platform Ubuntu) this doesn't seem to work.

@fractalyse
Copy link

Linux ab350 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ wget https://raw.githubusercontent.com/djselbeck/rapl-read-ryzen/master/ryzen.c
$ gcc -o ryzen ryzen.c -lm
$ sudo ./ryzen

0 (0), 1 (0), 2 (0), 3 (0), 4 (0), 5 (0), 6 (0), 7 (0)
8 (0), 9 (0), 10 (0), 11 (0), 12 (0), 13 (0), 14 (0), 15 (0)

Detected 16 cores in 1 packages

Core energy units: a1003
Time_unit:10, Energy_unit: 16, Power_unit: 3
Time_unit:0.000976562, Energy_unit: 1.52588e-05, Power_unit: 0.125
Core 0, energy used: 4.43466W, Package: 51.8207W
Core 1, energy used: 4.43466W, Package: 51.8207W
Core 2, energy used: 4.45755W, Package: 51.8207W
Core 3, energy used: 4.45755W, Package: 51.8207W
Core 4, energy used: 4.05014W, Package: 51.8207W
Core 5, energy used: 4.05014W, Package: 51.8207W
Core 6, energy used: 4.44519W, Package: 51.8207W
Core 7, energy used: 4.44519W, Package: 51.8207W
Core sum: 34.7751W

Seems to work correctly on 1700x under ubuntu 18.04

@cminnoy
Copy link
Author

cminnoy commented May 14, 2019

sudo ./ryzen
0 (0), 1 (0), 2 (0), 3 (0), 4 (0), 5 (0), 6 (0), 7 (0)
8 (0), 9 (0), 10 (0), 11 (0), 12 (0), 13 (0), 14 (0), 15 (0)

    Detected 16 cores in 1 packages

rdmsr:open: No such file or directory
Trying to open /dev/cpu/0/msr

uname -a
Linux hydro-one 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

CPU: Ryzen 7 1700X Pro

ls /dev/cpu
microcode

@cminnoy
Copy link
Author

cminnoy commented May 14, 2019

sudo modprobe msr

@fractalyse
Copy link

Yes, you have to insert module msr to get this working

@cminnoy
Copy link
Author

cminnoy commented May 15, 2019

Hi, are you sure the following is correct:

    0 (0), 1 (0), 2 (0), 3 (0), 4 (0), 5 (0), 6 (0), 7 (0)
    8 (0), 9 (0), 10 (0), 11 (0), 12 (0), 13 (0), 14 (0), 15 (0)

    Detected 16 cores in 1 packages

Core energy units: a1003
Time_unit:10, Energy_unit: 16, Power_unit: 3
Time_unit:0.000976562, Energy_unit: 1.52588e-05, Power_unit: 0.125
Core 0, energy used: 0.119476W, Package: 14.0265W
Core 1, energy used: 0.119476W, Package: 14.0265W
Core 2, energy used: 0.0297546W, Package: 14.0265W
Core 3, energy used: 0.0297546W, Package: 14.0265W
Core 4, energy used: 0.0758362W, Package: 14.0265W
Core 5, energy used: 0.0758362W, Package: 14.0265W
Core 6, energy used: 0.0270081W, Package: 14.0265W
Core 7, energy used: 0.0270081W, Package: 14.0265W
Core sum: 0.50415W

As you can see it runs from core 0 to core 7, with clearly core 0 and core1 having the same energy, and so on. I would have guessed that you should skip all uneven cores instead of just dividing core_count by 2. This is because of the hyperthreading.

Did you have a look at uProf from AMD?

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

No branches or pull requests

2 participants