My codes to check if GPUs are available after system reinstallation and creating new conda envs.
conda install -c conda-forge opencv
conda install -c conda-forge matplotlib
conda install -c conda-forge tqdm
conda install -c conda-forge notebook nb_conda_kernels jupyterlab tqdm
conda install -c conda-forge ipywidgets
One line:
conda install -c conda-forge matplotlib tqdm notebook nb_conda_kernels ipywidgets ipykernel
https://anaconda.org/nvidia/cuda-toolkit
conda install -c nvidia cuda-toolkit
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
Check the cuda version of pytorch installation (or if the pytorch supports cuda):
python3 -c "import torch; print(\"CUDA:\", torch.version.cuda)"
python3 -c "import torch; print('Torch:', torch.__version__); print('CUDA:', torch.version.cuda); import torchvision; print('Torchvision:', torchvision.__version__)"
python3 -c "import torch; print('Torch:', torch.__version__); print('CUDA:', torch.version.cuda); import torchvision; print('Torchvision:', torchvision.__version__); print([i/2**30 for i in torch.cuda.mem_get_info()])"
export CUDA_HOME=/usr/local/cuda
export PATH=${CUDA_HOME}/bin:${PATH}
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH
>> `GLIBCXX_3.4.30' not found >> reference
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/xxx/lib
pip install gdown