본문 바로가기
데이터분석/Pytorch

[Pytorch] 파이토치로 GPU 사용

by Kc93 2022. 11. 28.
728x90
반응형

python

 

print("GPU 가용여부 ", torch.cuda.is_available())
print("GPU 갯수 ", torch.cuda.device_count())
print("GPU 이름 ", torch.cuda.get_device_name(0))
device = "cuda:0" if torch.cuda.is_available() else "cpu"
print(device)
# 결과 값
GPU 가용여부  True
GPU 갯수  2
GPU 이름  NVIDIA GeForce RTX 3080 Ti
cuda:0
반응형

댓글