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

Deeprvat environment does not support cuda when created using conda #16

Open
endast opened this issue Aug 9, 2023 · 0 comments · Fixed by #17
Open

Deeprvat environment does not support cuda when created using conda #16

endast opened this issue Aug 9, 2023 · 0 comments · Fixed by #17
Labels
bug Something isn't working

Comments

@endast
Copy link
Collaborator

endast commented Aug 9, 2023

If you create the deeprvat environment using conda pytorch is not installed with CUDA enabled, hence no gpu is used:

(base)  magnus@pc003:~/code/deeprvat (main) 🦖$ conda  env create -f deeprvat_env.yaml  -n conda_deeprvat
...
(base)  magnus@pc003:~/code/deeprvat (main) 🦖$ conda activate conda_deeprvat
(conda_deeprvat) magnus@pc003:~/code/deeprvat (main) 🦖$  python
Python 3.8.17 | packaged by conda-forge | (default, Jun 16 2023, 07:06:00) 
[GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.device_count()
0
>>> print('Current cuda device ', torch.cuda.current_device())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/magnus/mambaforge/envs/conda_deeprvat/lib/python3.8/site-packages/torch/cuda/__init__.py", line 552, in current_device
    _lazy_init()
  File "/data/magnus/mambaforge/envs/conda_deeprvat/lib/python3.8/site-packages/torch/cuda/__init__.py", line 221, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
>>> 

When creating it using mamba cuda is enabled.

(base)  magnus@pc003:~/code/deeprvat (main) 🦖$ mamba env create -f deeprvat_env.yaml
...
(conda_deeprvat) magnus@pc003:~/code/deeprvat (main) 🦖$  conda activate deeprvat
(deeprvat) magnus@pc003:~/code/deeprvat (main) 🦖$  python
Python 3.8.17 | packaged by conda-forge | (default, Jun 16 2023, 07:06:00) 
[GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.device_count()
2
>>> print('Current cuda device ', torch.cuda.current_device())
Current cuda device  0
@endast endast linked a pull request Aug 9, 2023 that will close this issue
@endast endast closed this as completed in #17 Aug 9, 2023
@endast endast reopened this Aug 9, 2023
@endast endast added the bug Something isn't working label Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant