Answers for "check if cuda is available"

0

pytorch check gpu

In [1]: import torch

In [2]: torch.cuda.current_device()
Out[2]: 0

In [3]: torch.cuda.device(0)
Out[3]: <torch.cuda.device at 0x7efce0b03be0>

In [4]: torch.cuda.device_count()
Out[4]: 1

In [5]: torch.cuda.get_device_name(0)
Out[5]: 'GeForce GTX 950M'

In [6]: torch.cuda.is_available()
Out[6]: True
Posted by: Guest on November-27-2020
2

how to check cuda version

nvcc --version
Posted by: Guest on February-26-2020
0

check if cuda installed

# nvcc -V
 nvcc: NVIDIA (R) Cuda compiler driver
 Copyright (c) 2005-2015 NVIDIA Corporation
 Built on Tue_Aug_11_14:31:50_CDT_2015
 Cuda compilation tools, release 7.5, V7.5.17
Posted by: Guest on March-26-2021

Code answers related to "check if cuda is available"

Python Answers by Framework

Browse Popular Code Answers by Language