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

How can I increase number of CPUs? #12713

Closed
tbrodbeck opened this issue Dec 29, 2021 · 16 comments
Closed

How can I increase number of CPUs? #12713

tbrodbeck opened this issue Dec 29, 2021 · 16 comments
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue

Comments

@tbrodbeck
Copy link

tbrodbeck commented Dec 29, 2021

I have been trying to increase the amount of cpus of my podman because I am not able to start minikube:

minikube start --driver=podman --container-runtime=cri-o

πŸ˜„  minikube v1.24.0 on Darwin 12.0.1
✨  Using the podman (experimental) driver based on user configuration

β›”  Exiting due to RSRC_INSUFFICIENT_CORES: Requested cpu count 2 is greater than the available cpus of 1

How can I fix this? I am temporarily have to switch back to docker where it runs without a problem.

I could not find a reliable resource or explanation how to increase the amount of cpus podman uses.
I have tried

➜  ~ podman system renumber
Error: unrecognized command `podman system renumber`

Version (latest from brew):

➜  ~ podman --version
podman version 3.4.4
@rhatdan
Copy link
Member

rhatdan commented Dec 29, 2021

@giuseppe PTAL

@giuseppe
Copy link
Member

I don't think that error is coming from Podman. It looks like a check in Minikube itself. Are you running Podman as rootless? Does it work differently if you run as root?

@afbjorklund
Copy link
Contributor

afbjorklund commented Dec 29, 2021

@tbrodbeck

The amount of cpus and memory is set when the machine is created, so you will need to re-create it:

podman machine stop
podman machine rm
podman machine init --cpus 2 --memory 2048 --disk-size 20
podman machine start

Make sure to save any images and such before deleting, it might be possible to edit the json directly.

@afbjorklund
Copy link
Contributor

afbjorklund commented Dec 29, 2021

I don't think that error is coming from Podman. It looks like a check in Minikube itself

Podman defaults to 1 vCPU and 2 GiB RAM, while kubeadm requires 2 vCPU + 2 GiB

https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/

Also increased the disk size from 10 GiB to 20 GiB, since it is also tricky to do afterwards.

@afbjorklund
Copy link
Contributor

afbjorklund commented Dec 29, 2021

If there existed any "Podman Desktop" documentation for this, minikube could be linking to it:

        if availableCPUs < cpuCount {
                if driver.IsDockerDesktop(drvName) {
                        out.Styled(style.Empty, `- Ensure your {{.driver_name}} daemon has access to enough CPU/memory resources.`, out.V{"driver_name": drvName})
                        if runtime.GOOS == "darwin" {
                                out.Styled(style.Empty, `- Docs https://docs.docker.com/docker-for-mac/#resources`)
                        }
                        if runtime.GOOS == "windows" {
                                out.String("\n\t")
                                out.Styled(style.Empty, `- Docs https://docs.docker.com/docker-for-windows/#resources`)
                        }
                }

                exitIfNotForced(reason.RsrcInsufficientCores, "Requested cpu count {{.requested_cpus}} is greater than the available cpus of {{.avail_cpus}}", out.V{"requested_cpus": cpuCount, "avail_cpus": availableCPUs})
        }

But it would need to be user facing, I don't think the CLI help or the man page would be enough.

@rhatdan
Copy link
Member

rhatdan commented Dec 29, 2021

Interested in adding documentation?

@tbrodbeck
Copy link
Author

tbrodbeck commented Dec 29, 2021

Thanks. I was able to fix the error!
Still, I cannot get minikube starting. So I opened an issue in the minikube repo, FYI: kubernetes/minikube#13261

@giuseppe
Copy link
Member

Would it make sense to change the podman machine configuration to use 2 cpus?

@afbjorklund
Copy link
Contributor

afbjorklund commented Dec 29, 2021

Would it make sense to change the podman machine configuration to use 2 cpus?

Possibly, if you want it to run kubeadm ? Otherwise 1 vCPU and 1 GiB used to be fine...

(as in: docker-machine and podman-machine started out with those humble requirements)

But Lima uses 4 vCPU and 4 GiB by default, so I guess it depends on the situation.

i.e. the available resources on the local laptop, and how many VMs you plan to run ?

@afbjorklund
Copy link
Contributor

Interested in adding documentation?

I think it is documented in the man page:

https://docs.podman.io/en/latest/markdown/podman-machine-init.1.html

But there is no User Manual, as such.

@rhatdan
Copy link
Member

rhatdan commented Dec 29, 2021

Aren't these settings available in the containers.conf?

@afbjorklund
Copy link
Contributor

afbjorklund commented Dec 29, 2021

Still, I cannot get minikube starting. So I opened an issue in the minikube repo,

I don't think minikube works with podman remote / machine yet, it failed for me as well...

The first thing would be to switch the VM over to run regular containers instead of rootless:

podman system connection default podman-machine-default-root

Anyway, these issues are unrelated to how to make the VM have 2 vCPU instead of 1 vCPU

@afbjorklund
Copy link
Contributor

I could not find a reliable resource or explanation how to increase the amount of cpus podman uses.

https://podman.io/getting-started/installation#macos links to this page for "advanced":

https://github.com/containers/podman/blob/main/docs/tutorials/mac_experimental.md

It doesn't mention either --cpus or containers.conf, for changing the machine init.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@giuseppe
Copy link
Member

#12718 was merged. Closing the issue

@tpoxa
Copy link

tpoxa commented Jan 4, 2023

podman machine set podman-machine-default --cpus=2

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue
Projects
None yet
Development

No branches or pull requests

5 participants