NUMBER_OF_PROCESSORS not set on the windows workers

Would it be possible to set NUMBER_OF_PROCESSORS on the Windows workers? I noticed it is not set because our builds takes long, this is normally set by Windows for the amount of processors available.

Hi @jwillemsen ,

GitHub hosts Windows runners on Standard_DS2_v2 virtual machines in Microsoft Azure, more compute options may be added in the future but currently it’s not supported to set the number of the processors.

The first offering here will be the ability to provide self-hosted runners, so you can bring your own compute needs to GitHub Actions.  

Thanks.

It would help when NUMBER_OF_PROCESSORS would be set by GitHub/azure, so that we can retrieve the number of processors available in our script

Thanks for your reply! @jwillemsen. According to the policy, it’s recommened to raise a ticket here where github product manager will take a review.

I’m a bit confused.  If you run the following:

gci env:* | sort-object name

NUMBER_OF_PROCESSORS is set to 2?

See any Windows job at https://github.com/MSP-Greg/actions-image-testing/actions

1 Like

Thanks @msp-greg , you’re right, the ‘NUMBER_OF_PROCESSORS’ can be got from env.

And the value can be set via ‘set-env’ command, code sample as below:

- name: set Number of processors
        run: |
          echo "::set-env name=NUMBER_OF_PROCESSORS::1"

Hi @jwillemsen , sorry i misunderstood. No error reported if you change the value, but since the hosted runner is a 'Standard_DS2_v2 virtual machines in Microsoft Azure, i’m not sure if it works for you, could you please kindly check? Thanks.

Thanks, I will retest, one remark, instead of powershell I am using cmd as shell.

Can confirm that it is set, didn’t check the logs in enough detail