Conda is a manager for environments, especially in python.
There is also mamba.
To use another version of CUDA than the default in a conda environment you have to set env-variables:
CUDA_PATH=$CONDA_PREFIX
CUDA_HOME=$CONDA_PREFIX
Since these variables are only evaluated while running the command, this needs to be run every time the environment is changed. An easier solution is to write this into the conda environment config.
An example file would be:
name: myProjectName
channels:
- "nvidia/label/cuda-11.8.0" # see available versions at https://anaconda.org/nvidia/cuda
dependencies:
- python = 3.11
- pip
- ipykernel
- nvidia/label/cuda-11.8.0::cuda
- pip:
- diffusers
variables:
CUDA_PATH: $CONDA_PREFIX
CUDA_HOME: $CONDA_PREFIX