Unable to empty cuda cache - PyTorch Forums
discuss.pytorch.org › t › unable-to-empty-cuda-cacheOct 16, 2020 · I’m trying to free some GPU memory so that other processes can use it. I tried to do that by executing torch.cuda.empty_cache() after deleting the tensor but for some reason it doesn’t seem to work. I wrote this small script to replicate the problem os.environ['CUDA_VISIBLE_DEVICES'] = '0' showUtilization() t = torch.zeros((1, 2**6, 2**6)).to(f'cuda') showUtilization() del t torch.cuda ...