View local or remote server GPU and usage method based on Pytorch
1. View GPU specific information
nvidia-smi
2. View local or remote server GPU based on Pytorch
import torch
print(torch.cuda.is_available() )
print(torch.cuda.device_count() )
print(torch.cuda.current_device())
print(torch.cuda.get_device_name(0))
3. How to use GPU (typical)
device = torch.cuda.current_device() if args.cuda else torch.device('cpu')
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
os.environ['CUDA_VISIBLE_DEVICES']='0'