leobcc commited on
Commit
b1fef32
·
1 Parent(s): 35ab1e2

Updated check_gpu_availability script

Browse files
Files changed (2) hide show
  1. check_gpu_availability +3 -0
  2. code/check_cuda.py +0 -11
check_gpu_availability CHANGED
@@ -2,6 +2,9 @@ import torch
2
 
3
  if torch.cuda.is_available():
4
  device = torch.device("cuda")
 
 
 
5
  print(f"GPU {torch.cuda.get_device_name(0)} is available")
6
  else:
7
  device = torch.device("cpu")
 
2
 
3
  if torch.cuda.is_available():
4
  device = torch.device("cuda")
5
+ print("Torch version:",torch.__version__)
6
+ print("Is CUDA enabled?",torch.cuda.is_available())
7
+ print("Number of GPUs available:", torch.cuda.device_count())
8
  print(f"GPU {torch.cuda.get_device_name(0)} is available")
9
  else:
10
  device = torch.device("cpu")
code/check_cuda.py DELETED
@@ -1,11 +0,0 @@
1
- import torch
2
-
3
- print("Number of GPUs:", torch.cuda.device_count())
4
-
5
- print("Torch version:",torch.__version__)
6
-
7
- print("Is CUDA enabled?",torch.cuda.is_available())
8
-
9
- print(torch.cuda.device_count())
10
-
11
- # pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html