GithubHelp home page GithubHelp logo

Comments (4)

davidr avatar davidr commented on May 30, 2024 1

Absolutely no apologies necessary. This was exceptionally helpful, and I'll work out the rest. Again, many many thanks for this work.

from undervolt.

davidr avatar davidr commented on May 30, 2024

Out of curiosity, how did you come by the logic to do this? This stuff obviously isn't documented super well, and I'm trying to follow along in unpack_offset() and unconvert_rounded_offset(), and there's deep mojo there I don't understand, particularly:

in unpack_offset():

plane_index = int(msr_response / (1 << 40))
return unconvert_offset(msr_response ^ (plane_index << 40))

I haven't looked super hard, but I've yet to run into a situation where plane_index is anything other than 0 for any call of read_offset(). In your sample code, you unpack a value of "0x40000000000", so maybe your CPUs are just returning something in those 40:36 bits that mine aren't? No matter what plane I write to the MSR mailbox and then read, those bits are zeroed for me, even though the read will return the correct offset. (I'm testing on i7-8650U)

and in unconvert_rounded_offset():

return x if x <= 1024 else - (2048 - x)

I'm not sure I understand why this is necessary.

At any rate, there's so little information on this available, your code is astonishingly helpful to everyone looking. Thank you so much for all your work!

from undervolt.

georgewhewell avatar georgewhewell commented on May 30, 2024

@davidr Most of the information was gathered from this repo, which in turn collected information from this thread.

re: unpack_offset- it was reported in #9 that CPUs earlier than Gen 5 include the plane index in the returned value, so it must be stripped before converting back to voltage. I confirmed this on older machine, although on a modern machine I see the same results as you.

re: unconvert_rounded_offset- I forget why this is necessary. If you change this to just return y >> 21, tests will fail like so:

File "/home/grw/src/undervolt/undervolt.py", line 90, in undervolt.unconvert_offset
Failed example:
    unconvert_offset(0xf0000000)
Expected:
    -125.0
Got:
    1875.0

So it seems to be because the return value is in the domain [0-2048], but we want [-1024, 1024]. Sorry I can't explain more!

from undervolt.

sesam avatar sesam commented on May 30, 2024

from undervolt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.