Running a container with multiple cpus fails

Continuing the discussion from Unable to use --cpus for docker run:

I got the same error today.

Here is to reproduce it:

docker run -it --name lmr olympusmonds/earthbyte_underworld -cpus 12

You need to set the cpu flag before the image name, as everything after is passed to the container as command line arguments. See doc.

Thanks! It solved part of the problem… Now I am facing with the following error:

I asked for 8 CPUs and the computer told me that there are only 4 CPUs available. The computer (Windows 10) i am using has actually 24 CPUs available to use.

“docker: Error response from daemon: Range of CPUs is from 0.01 to 4.00 as there are only 4 CPUs available”.

I guess I have to find where the docker reads 4 CPUs from?

I assume you are using Docker Desktop, which runs Docker in a Linux VM - which is probably set to 4 CPUs.

Yes, I downloaded Docker Desktop, pulled an image, and trying to run the container from Windows Powershell with 12 or 24 CPUs.