Hello @artemis, thanks for confirming that CUDA 11.8 worked.
Here are the steps to setup a Conda environment with Pytorch 2.0+CUDA 11.8:
Install miniconda. You can run it without super user privileges and keep it local. See link here on how to download and configure: https://docs.conda.io/en/latest/miniconda.html.
For my example I will setup Python 3.9 so here’s what I downloaded and ran. Just follow the prompts:
Python 3.9
wget https://repo.anaconda.com/miniconda/Miniconda3-py39_23.3.1-0-Linux-x86_64.sh
chmod u+x Miniconda3-py39_23.3.1-0-Linux-x86_64.sh
bash Miniconda3-py39_23.3.1-0-Linux-x86_64.sh
Create your environment. I created an python3.9 environment named ‘test’. Make sure you activate your environment:
conda create -n test python=3.9
conda activate test
Install the required pytorch packages. You may notice that we use the test environment’s ‘pip’ so that it will be installed only within the domain we are setting up:
/home/ubuntu/miniconda3/envs/test/bin/pip install torch==2.0.0+cu118 torchaudio==2.0.0+cu118 torchvision==0.15.0+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
Install the other CUDA packages:
conda install cudnn
conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit
conda install -c "nvidia/label/cuda-11.8.0" cuda-nvcc
conda install -c "nvidia/label/cuda-11.8.0" cuda-runtime
After that, test the pytorch installation:
python -c 'import torch ; print("PyTorch Version: ",torch.__version__) ; print("Is available: ", torch.cuda.is_available()) ; print("Current Device: ", torch.cuda.current_device()) ; print("Pytorch CUDA Compiled version: ", torch._C._cuda_getCompiledVersion()) ; print("Pytorch version: ", torch.version) ; print("pytorch file: ", torch.__file__) ; print("Number of GPUs: ",torch.cuda.device_count())'
Here’s what mine looks like:
(test) ubuntu@209-20-158-254:~$ python -c 'import torch ; print("PyTorch Verison: ",torch.__version__) ; print("Is available: ", torch.cuda.is_available()) ; print("Current Device: ", torch.cuda.current_device()) ; print("Pytorch CUDA Compiled version: ", torch._C._cuda_getCompiledVersion()) ; print("Pytorch version: ", torch.version) ; print("pytorch file: ", torch.__file__) ; print("Number of GPUs: ",torch.cuda.device_count())'
PyTorch Verison: 2.0.0+cu118
Is available: True
Current Device: 0
Pytorch CUDA Compiled version: 11080
Pytorch version: <module 'torch.version' from '/home/ubuntu/miniconda3/envs/test/lib/python3.9/site-packages/torch/version.py'>
pytorch file: /home/ubuntu/miniconda3/envs/test/lib/python3.9/site-packages/torch/__init__.py
Number of GPUs: 1