Check for gpus only once.

gpus are counted every time measure_locally is called. This means that if the nvidia script is now available, the error message is printed multiple times. This commit fixes this.