-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Determine total memory without psutil #12787
Conversation
One option to check win/macOS/Linux would be to add to the test something like |
This is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, LGTM!
While I'm at it, I don't get any CPU name on my Mac, and at least for macOS I have an easy fix. Do you want me to include it in this PR or a new one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works on Linux and I'll trust the CIs for the other OSes, thanks @cbrnr !
Sure, feel free to push here |
This gives
instead of
I can try to get this to work on Linux and Windows tomorrow. |
OK, this is now ready again. I've tested on all three platforms and got nice CPU strings as well as the correct memory size, but if you have hardware such as Intel-based Macs (I only tested on ARM-based Macs), please feel free to check the output of |
I'm using Candidate replacements:
|
Can we not output GB instead of GiB? no-one except for a few CS and IT / tech-savvy folks will know what GiB is |
Only if we really show GB (base 1000). |
yes that's what I meant |
OK, but this changes the numbers then. Previously, we computed GiB but erroneously wrote GB. |
IMO, GiB is not that esoteric and people can always look it up with their search engine if they're not familiar. For me the first few hits are unrelated but hits 4 and 5 are "what is a GibiByte (GiB)?" and "GB vs GiB what's the difference?" |
I agree! In principle, I don't care what we use as long as we use the correct unit though. |
The tools I checked on Linux use GiB, the activity monitor or macOS says GB. No opinion from me on which to use but agree it would be nice to get the unit right. Current approach appears to be failing on Windows CIs, though |
I suggest we get this in early for 1.9 rather than just before 1.8. Might be good to have a bit more time to test it, I don't think this is a critical blocker, and we still need to converge a bit. |
I mean, it's only the memory calculation which is currently failing. I could try and play around a bit more, but I'm also fine with moving it to 1.9. |
This is now finally ready for review again. Everything seems to be working fine on all platforms. |
mne/utils/config.py
Outdated
else: | ||
total_memory = -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not raise
here, so that later the exception will get caught and a ?
will get displayed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, done!
Thanks @cbrnr ! |
Fixes #12785. We've always computed gibibytes (GiB), so I've also fixed the unit (was previously GB).