Pytorch-Memory-Utils
Pytorch-Memory-Utils copied to clipboard
Always show the first gpu?
Multi-GPUs in some machine, how can make the program show the memory of other gpus? I have tested CUDA_VISIBLE_DEVICES, os.environ['VCUDA_VISIBLE_DEVICES'], but they didnot be effective.
After setting os.environ['CUDA_VISIBLE_DEVICES'] in your code, you should
change
gpu_tracker = MemTracker(frame)
to:
gpu_tracker = MemTracker(frame, device=int(os.getenv("CUDA_VISIBLE_DEVICES")))