Hello Flock!



 Flock1:

While working or if I leave the machine for some time and come back, PyTorch stops recognizing the GPU. And the only way it starts recognizing the GPU is after rebooting the machine.


Just to share my experience (with an old version of pytorch and an
old gpu):
I see something similar to this.  If I launch a fresh python session
and run a pytorch script that uses cuda, then if I don’t use cuda
(or maybe just the python session) for a short-ish amount of time,
future use of cuda in that python session fails.
But I don’t have to reboot my machine or “reload the gpu” to get
it working again; I only have to exit and restart python.
I haven’t found any fix for it – I just live with it, restarting python as
necessary.
Here’s a post of mine with some related observations:

  
    
    
    Some observations on "cuda runtime error (30)" 
  
  
    Hello Forum! 
I have some information about the behavior of “cuda runtime 
error (30)” (probably somewhat specific to my particular 
configuration). 
This is a follow-on to a number of threads about “error 30,” 
and, in particular, to this post: 


Clued in by Andrei’s observation that torch.cuda.is_available() 
“breaks” cuda, I find (for me) that if torch.cuda.is_available() 
is the first cuda call, subsequent cuda calls will throw “error 30” 
unless the first subsequent call is called promptly…
  


Best.
K. Frank