8. torch
Installation#
8.1. Windows#
8.1.1. CPU#
If you don’t have a GPU or want to install the CPU version of torch
, you can install with:
install.packages("torch")
8.1.2. GPU#
Since version 0.1.1 torch
supports GPU installation on Windows. In order to use GPU’s with torch you need to:
Check your GPU is CUDA compatible or not, click here
Install NVIDIA CUDA toolkit 11.7
Installation Instruction
run
nvcc --version
in the Command line to check the installation
H:\>nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Tue_May__3_19:00:59_Pacific_Daylight_Time_2022 Cuda compilation tools, release 11.7, V11.7.64 Build cuda_11.7.r11.7/compiler.31294372_0
Install CuDNN 8.5.0 for Windows
Move it to
C:\Program Files
(Recommended)Add the
C:\Program Files\CuDNN8.5.0\bin
into System Path
Once you have installed all pre-requisites you can install
torch
with:install.packages("torch")
library(torch)
and install additional software automaticallyWill get msg
Additional software needs to be downloaded and installed for torch to work correctly.
when first runlibrary
commandOnce finished, run
cuda_device_count()
, it returns the number of GPUs available.it should give you result
1