no CUDA-capable device is detected

When using __GPU with ray and performing parallel processing, the following error appears.

RuntimeError: cuda runtime error (100) : no CUDA-capable device is detected at /opt/conda/conda-bld/pytorch_1591914855613/work/aten/src/THC/THCGeneral.cpp:47

How to deal with the error

I've been thinking about this error for a long time, but I didn't know the exact answer. .. .. ..

However, I found a way to use the GPU with ray even with this error.

That is to add the following code to the program you want to run.

while True:
     input = input()
     #The code you want to execute below
     :
     :

The above code will be described. First, while True is an infinite loop. input () is an input. Then put the code you want to execute in while True.

If you get an error like the title, use control C to re-enter. And again, make an appropriate input. Then the error disappears and it can be executed.

When you finish running

Because it's an infinite loop Press control C to exit.

I will report again if I find a real solution.

Recommended Posts

no CUDA-capable device is detected
When "No changes detected" is displayed in python3 manage.py makemigrations
There is no switch in python
Folium's HeatMapWithTime is no longer plotted