Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to run models on GPU #141

Open
edstowe opened this issue Jun 12, 2024 · 0 comments
Open

Failing to run models on GPU #141

edstowe opened this issue Jun 12, 2024 · 0 comments

Comments

@edstowe
Copy link

edstowe commented Jun 12, 2024

Hello, many thanks for creating this package.

I have attempted to install sjSDM to run on my NVIDIA GPU (NVIDIA T400 4GB). When I run the toy example in the introductory vignette, it runs properly, but uses the CPU instead of the GPU, even though I believed that I installede it for use with the GPU. When I force the sjSDM() function to use the GPU using the device = "gpu", I get the following error:

Error in py_call_impl(callable, call_args$unnamed, call_args$named) : AssertionError: Torch not compiled with CUDA enabled.

I tried to install sjSDM several times, based on some of the advice you provided to others with installation issues. Here is the code I used:

devtools::install_github("https://github.com/TheoreticalEcology/s-jSDM", subdir = "sjSDM", ref = "master")

reticulate::conda_remove("r-sjSDM")reticulate::conda_create(envname = "r-sjsdm", python_version = "3.11")

reticulate::conda_install(envname = "r-sjsdm", packages =c("pytorch", "torchvision", "torchaudio", "pytorch-cuda=11.7", "-c", "pytorch", "-c" ,"nvidia"))

reticulate::conda_install(envname = "r-sjsdm", packages = c("pyro-ppl", "torch_optimizer", "madgrad", "tqdm"), pip = TRUE)
library(sjSDM)

Any help you can provide on getting this to work on the CPU would be much appreciated. Here are the install diagnostics:

install_diagnostic()

name python

1 base C:\Users\rdel1ess\AppData\Local\anaconda3/python.exe
2 r-sjsdm C:\Users\rdel1ess\AppData\Local\anaconda3\envs\r-sjsdm/python.exe

ENV: base

torch:

packages in environment at C:\Users\rdel1ess\AppData\Local\ANACON~1:

Name Version Build Channel

numpy:

packages in environment at C:\Users\rdel1ess\AppData\Local\ANACON~1:

Name Version Build Channel

numpy 1.26.4 py311hdab7c0b_0
numpy-base 1.26.4 py311hd01c5d8_0
numpydoc 1.5.0 py311haa95532_0

ENV: r-sjsdm

torch:

packages in environment at C:\Users\rdel1ess\AppData\Local\ANACON~1\envs\r-sjsdm:

Name Version Build Channel

pytorch 2.3.1 py3.11_cpu_0 pytorch
pytorch-cuda 11.7 h16d0643_5 pytorch
pytorch-mutex 1.0 cpu pytorch
pytorch-ranger 0.1.1 pypi_0 pypi
torch-optimizer 0.3.0 pypi_0 pypi
torchaudio 2.3.1 py311_cpu pytorch
torchvision 0.18.1 py311_cpu pytorch

numpy:

packages in environment at C:\Users\rdel1ess\AppData\Local\ANACON~1\envs\r-sjsdm:

Name Version Build Channel

numpy 1.26.4 py311h0b4df5a_0 conda-forge

python: C:/Users/rdel1ess/AppData/Local/anaconda3/envs/r-sjsdm/python.exe
libpython: C:/Users/rdel1ess/AppData/Local/anaconda3/envs/r-sjsdm/python311.dll
pythonhome: C:/Users/rdel1ess/AppData/Local/anaconda3/envs/r-sjsdm
version: 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:27:10) [MSC v.1938 64 bit (AMD64)]
Architecture: 64bit
numpy: C:/Users/rdel1ess/AppData/Local/anaconda3/envs/r-sjsdm/Lib/site-packages/numpy
numpy_version: 1.26.4
torch: C:\Users\rdel1ess\AppData\Local\ANACON~1\envs\r-sjsdm\Lib\site-packages\torch_init_.p

NOTE: Python version was forced by use_python() function

 active environment : C:/Users/rdel1ess/AppData/Local/anaconda3
active env location : C:/Users/rdel1ess/AppData/Local/anaconda3
   user config file : C:\Users\rdel1ess\.condarc

populated config files :
conda version : 24.1.2
conda-build version : 24.1.2
python version : 3.11.7.final.0
solver : libmamba (default)
virtual packages : __archspec=1=x86_64
__conda=24.1.2=0
__cuda=12.2=0
__win=0=0
base environment : C:\Users\rdel1ess\AppData\Local\ANACON1 (writable)
conda av data dir : C:\Users\rdel1ess\AppData\Local\ANACON
1\etc\conda
conda av metadata url : None
channel URLs : https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\Users\rdel1ess\AppData\Local\ANACON1\pkgs
C:\Users\rdel1ess.conda\pkgs
C:\Users\rdel1ess\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\rdel1ess\AppData\Local\ANACON
1\envs
C:\Users\rdel1ess.conda\envs
C:\Users\rdel1ess\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/24.1.2 requests/2.31.0 CPython/3.11.7 Windows/10 Windows/10.0.19045 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.6 aau/0.4.3 c/FAzFD8gRnsxwHPTusSXqpA s/seCXrVXnW-ZSZO4W9aVeHA e/UCmhitd5p_yXzqS3PoBhfA
administrator : False
netrc file : None
offline mode : False

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant