conda install cudatoolkit==10.1.243 cudnn tensorflow-gpu
This is from https://www.tensorflow.org/install/gpu
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
sudo apt-get update
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo apt install ./nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo apt-get update
sudo apt-get install --no-install-recommends nvidia-driver-450
nvidia-smi
wget https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/libnvinfer7_7.1.3-1+cuda11.0_amd64.deb
sudo apt install ./libnvinfer7_7.1.3-1+cuda11.0_amd64.deb
sudo apt-get update
sudo apt-get install --no-install-recommends \
cuda-11-0 \
libcudnn8=8.0.4.30-1+cuda11.0 \
libcudnn8-dev=8.0.4.30-1+cuda11.0
sudo apt-get install -y --no-install-recommends libnvinfer7=7.1.3-1+cuda11.0 \
libnvinfer-dev=7.1.3-1+cuda11.0 \
libnvinfer-plugin7=7.1.3-1+cuda11.0
Download installer from: https://www.anaconda.com/download/#linux
Include the bash command regardless of whether or not you are using Bash shell.
If you did not download to your Downloads directory, replace ~/Downloads/ with the path to the file you downloaded.
bash ~/Downloads/Anaconda3-YYYY.MM-Linux-x86_64.sh
Scroll to the bottom of the license terms and enter “Yes” to agree.
Accept the default install location.
The installer prompts “Do you wish the installer to initialize Anaconda3 by running conda init?” Choose “yes”.
Close and open your terminal window for the installation to take effect, or you can enter the command:
source ~/.bashrc
To run conda from anywhere without having the base environment activated by default, use:
conda config --set auto_activate_base False
git clone https://github.com/Htnek/environment.git
conda env create -f environment.yml
conda activate tf2
python -m ipykernel install --user --name=python3
Find it with:
jupyter kernelspec list
Remove it with:
jupyter kernelspec uninstall unwanted-kernel
jupyter notebook
conda env update --file environment.yml --prune
Show name of environment
conda info --envs
Removal of environment
conda remove --name name_of_environment --all
Start a terminal
conda activate tf2
Start python
python
In python write:
import tensorflow as tf
In python write:
tf.config.list_physical_devices('GPU')
If all goes well you will see:
Adding visible gpu devices: 0
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
watch -n 1 nvidia-smi