When I shut down the pytorch program by kill, I encountered the problem with the GPU

I had the same problem. The easy solution is to reset the pc or reset the memory from the GPU (that work for me):

sudo nvidia-smi --gpu-reset

But I don’t know why this happens, only that I have to stops the scripts using ctrl-c.

2 Likes