File size: 552 Bytes
fd601de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import torch


# print cuda and cudnn version

print('version of torch:',torch.__version__)

  

print('cuda available:', torch.cuda.is_available())

  

print('version of cuda:',torch.version.cuda)

  

print('version of cudnn:',torch.backends.cudnn.version())

  

# print all GPUs using pytorch

  

#print(torch.utils.collect_env)

  

print('device number:',torch.cuda.device_count())

  

for i in range(torch.cuda.device_count()):

    print(f'device {i}:',torch.cuda.get_device_name(i))

  
print('current device:', torch.cuda.current_device())