Deep-Learning-and-Scientific-Computing-with-R-torch icon indicating copy to clipboard operation
Deep-Learning-and-Scientific-Computing-with-R-torch copied to clipboard

`t1$to(device = "cuda")` Error in (function (self, device, dtype, non_blocking, copy, memory_format) : PyTorch is not linked with support for cuda devices

Open danli349 opened this issue 1 year ago • 0 comments

Hello

I install cuda using conda install cuda -c nvidia

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Wed_Feb__8_05:53:42_Coordinated_Universal_Time_2023
Cuda compilation tools, release 12.1, V12.1.66
Build cuda_12.1.r12.1/compiler.32415258_0

How should I solve this problem?

t2 <- t1$to(device = "cuda")
Error in (function (self, device, dtype, non_blocking, copy, memory_format)  : 
  PyTorch is not linked with support for cuda devices
Exception raised from getDeviceGuardImpl at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\c10/core/impl/DeviceGuardImplInterface.h:319 (most recent call first):
00007FFD35C8D24200007FFD35C8D1E0 c10.dll!c10::Error::Error [<unknown file> @ <unknown line number>]
00007FFD35C8CE8A00007FFD35C8CE30 c10.dll!c10::detail::torchCheckFail [<unknown file> @ <unknown line number>]
00007FFC7469210600007FFC74691F60 torch_cpu.dll!at::Context::getDeviceFromPtr [<unknown file> @ <unknown line number>]
00007FFC74B80F2900007FFC74B80ED0 torch_cpu.dll!at::native::to [<unknown file> @ <unknown line number>]
00007FFC758C0A2300007FFC758BAAC0 torch_cpu.dll!at::compositeimplicitautograd::where [<unknown file> @ <unknown line number>]
00007FFC758A824800007FFC75860E20 torch_cpu.dll!at::compositeimplicitautograd::broadcast_to_symint [<unknown file> @ <unknown line number>]
00007FFC750DA36900007FFC750DA190 torch_cpu.dll!at::_ops::to_devic

danli349 avatar Jan 26 '24 20:01 danli349