Search code examples
pythonpytorchcudacondaminiconda

As a non-root user, how to install another version cuda in conda environment in Linux server?


I am a non-root user in a Linux server, when I input nvidia-smi it shows my cuda is 10.2.

However, my project is asked to pip install torch==1.10.0+cu111 torchvision==0.11.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html

Now, I have create my own environment, for example, cu111, by conda create --name cu111 python=3.10 and conda activate cu111 What should I do step by step, the first step is following pip install torch==1.10.0+cu111 torchvision==0.11.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html ,right?

I read some tutorial, it asked to add path variable in your environment, but I am not sure if it is correct,

export PATH=/home/dj/miniconda3/envs/cu111/lib/:$PATH

Any suggestion is helpful for me!


Solution

  • I am a non-root user in a Linux server, when I input nvidia-smi it shows my cuda is 10.2.

    The "CUDA version" shown by nvidia-smi is the maximum CUDA version supported by the GPU driver installed on the system. That means that no matter what CUDA toolkit or CUDA accelerated framework you choose to install, nothing newer than CUDA 10.2 or anything compiled against anything newer than CUDA 10.2 will actually work on the machine in question. If you install a version of PyTorch compiled against CUDA 11.1, it cannot work on the machine in its current state.

    If you are a non-root user, there is nothing you can do to fix this other than ask a system administrator to perform a driver upgrade (if that is possible, i.e. the hardware is actually supported by a more modern driver).