Giter VIP home page Giter VIP logo

Comments (11)

bartaz avatar bartaz commented on August 19, 2024

Seems that while M1 Pro has 10 cores, only 8 are "high performance" cores available for virtualisation (my understanding).

In sysctl -a we can see:

hw.ncpu: 10
… 
hw.perflevel0.physicalcpu: 8
hw.perflevel0.physicalcpu_max: 8
hw.perflevel0.logicalcpu: 8
hw.perflevel0.logicalcpu_max: 8

On older Intel Mac:

hw.ncpu: 8
…
hw.perflevel0.physicalcpu: 4
hw.perflevel0.physicalcpu_max: 4
hw.perflevel0.logicalcpu: 8
hw.perflevel0.logicalcpu_max: 8

from dotrun.

bartaz avatar bartaz commented on August 19, 2024

Changing
https://github.com/canonical-web-and-design/dotrun/blob/a1943631447c5b17537150a219b025027263ea3c/scripts/install-with-multipass.sh#L56

to:

TOTAL_CPUS=$(sysctl -n hw.perflevel0.logicalcpu)

seems to work, but I don't know how backwards compatible it is with other Macs.

from dotrun.

cristinadresch avatar cristinadresch commented on August 19, 2024

@jkfran can you help triage this one pls

from dotrun.

jkfran avatar jkfran commented on August 19, 2024

Changing

https://github.com/canonical-web-and-design/dotrun/blob/a1943631447c5b17537150a219b025027263ea3c/scripts/install-with-multipass.sh#L56

to:

TOTAL_CPUS=$(sysctl -n hw.perflevel0.logicalcpu)

seems to work, but I don't know how backwards compatible it is with other Macs.

I am happy about doing this change. So, did you check that sysctl -n hw.perflevel0.logicalcpu works on Intel Macs?

from dotrun.

bartaz avatar bartaz commented on August 19, 2024

I am happy about doing this change. So, did you check that sysctl -n hw.perflevel0.logicalcpu works on Intel Macs?

Yes, this is working on Intel Macs (with latest macOS version), I can later check on older mac with older macOS to be sure (if we care about that).

from dotrun.

bartaz avatar bartaz commented on August 19, 2024

@jkfran so, it works on latest macOS (Monterey) both on M1 and Intel.

It does not work on old macOS (Mojave 10.14.6). It is couple years old OS and I don't know since when the hw.perflevel0.logicalcpu was introduced.

Maybe it would be possible to do sysctl -n hw.perflevel0.logicalcpu OR sysctl -n hw.ncpu? I'm not sure how to make conditionals in bash script in such way.

The other way would be not specify number of CPUs at all and let multipass use the default. Why we are not using the default? It is too small?

from dotrun.

bartaz avatar bartaz commented on August 19, 2024

TOTAL_CPUS=$(sysctl -n hw.perflevel0.logicalcpu || sysctl -n hw.ncpu) maybe?

This will still show error message when sysctl -n hw.perflevel0.logicalcpu fails I guess, but should still store correct value.

from dotrun.

anthonydillon avatar anthonydillon commented on August 19, 2024

@jkfran are you working on this issue?

from dotrun.

jkfran avatar jkfran commented on August 19, 2024

We discussed a v2 of dotrun based on Docker. Here are the meeting notes, so this issue shouldn't any longer apply.

I will notify everyone as soon as we get the first beta of dotrun v2.

from dotrun.

anthonydillon avatar anthonydillon commented on August 19, 2024

@jkfran are you actively working on this? If so, can you add estimate and epic please?

from dotrun.

jkfran avatar jkfran commented on August 19, 2024

I am closing this issue as it doesn't affect dotrun v2. Thank you!

from dotrun.

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.