# getGPUs error when no GPU avaliable

**URL:** <https://discuss.ray.io/t/getgpus-error-when-no-gpu-avaliable/11301>\
**Category:** Ray Tune\
**Created:** [July 7, 2023, 2:11pm UTC](https://discuss.ray.io/t/getgpus-error-when-no-gpu-avaliable/11301 "2023-07-07T14:11:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![h-aze](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/h-aze/32/4711_2.png) [@h-aze](https://discuss.ray.io/u/h-aze)\
**Post date:** [July 7, 2023, 2:11pm UTC](https://discuss.ray.io/t/getgpus-error-when-no-gpu-avaliable/11301/1 "2023-07-07T14:11:46Z")

</div>

Hi, I’m using ray tune on my laptop and I don’t have any GPU’s so would like to use my CPU to perform tuning. I’m using tune.with\_resources to specify that I would like to use 1 CPU, however, I am still getting errors. It calls “getGPUs” even though I’ve specified I want to use a CPU and then returns an error as it gets back ‘No devices were found’. How can I get around this error? Here is the full error I am getting:

> File “main.py”, line 97, in   
> main(args)  
> File “main.py”, line 9, in main  
> run.regular(  
> File “/home/jd18380/Documents/ContinualLearning/run.py”, line 15, in regular  
> tune\_hyperparams(data\_name, model\_name, optimizer\_type, selection\_metric=“top\_test\_accuracy”)  
> File “/home/jd18380/Documents/ContinualLearning/param\_tune.py”, line 101, in tune\_hyperparams  
> results = tuner.fit()  
> File “/home/jd18380/Documents/venv\_CL-exp/lib/python3.8/site-packages/ray/tune/tuner.py”, line 347, in fit  
> return self.\_local\_tuner.fit()  
> File “/home/jd18380/Documents/venv\_CL-exp/lib/python3.8/site-packages/ray/tune/impl/tuner\_internal.py”, line 588, in fit  
> analysis = self.\_fit\_internal(trainable, param\_space)  
> File “/home/jd18380/Documents/venv\_CL-exp/lib/python3.8/site-packages/ray/tune/impl/tuner\_internal.py”, line 712, in \_fit\_internal  
> analysis = run(  
> File “/home/jd18380/Documents/venv\_CL-exp/lib/python3.8/site-packages/ray/tune/tune.py”, line 583, in run  
> \_ray\_auto\_init(entrypoint=error\_message\_map[“entrypoint”])  
> File “/home/jd18380/Documents/venv\_CL-exp/lib/python3.8/site-packages/ray/tune/tune.py”, line 225, in \_ray\_auto\_init  
> ray.init()  
> File “/home/jd18380/Documents/venv\_CL-exp/lib/python3.8/site-packages/ray/\_private/client\_mode\_hook.py”, line 103, in wrapper  
> return func(\*args, \*\*kwargs)  
> File “/home/jd18380/Documents/venv\_CL-exp/lib/python3.8/site-packages/ray/\_private/worker.py”, line 1534, in init  
> \_global\_node = ray.\_private.node.Node(  
> File “/home/jd18380/Documents/venv\_CL-exp/lib/python3.8/site-packages/ray/\_private/node.py”, line 290, in **init**  
> self.start\_ray\_processes()  
> File “/home/jd18380/Documents/venv\_CL-exp/lib/python3.8/site-packages/ray/\_private/node.py”, line 1213, in start\_ray\_processes  
> resource\_spec = self.get\_resource\_spec()  
> File “/home/jd18380/Documents/venv\_CL-exp/lib/python3.8/site-packages/ray/\_private/node.py”, line 459, in get\_resource\_spec  
> self.\_resource\_spec = ResourceSpec(  
> File “/home/jd18380/Documents/venv\_CL-exp/lib/python3.8/site-packages/ray/\_private/resource\_spec.py”, line 175, in resolve  
> num\_gpus = \_autodetect\_num\_gpus()  
> File “/home/jd18380/Documents/venv\_CL-exp/lib/python3.8/site-packages/ray/\_private/resource\_spec.py”, line 278, in \_autodetect\_num\_gpus  
> gpu\_list = GPUtil.getGPUs()  
> File “/home/jd18380/Documents/venv\_CL-exp/lib/python3.8/site-packages/GPUtil/GPUtil.py”, line 102, in getGPUs  
> deviceIds = int(vals[i])  
> ValueError: invalid literal for int() with base 10: ‘No devices were found’
