...
Code Block |
---|
language | bash |
---|
title | Adding NVIDIA tools to path |
---|
|
# NVIDIA tools are available in /usr/local/cuda-11.8/bin/. You can add them to PATH following:
$ export PATH=$PATH:/usr/local/cuda-11.8/bin/ |
Installing Libraries
You can install a variety of libraries using different methods. Below, we have a basic tutorial showing you how you can install libraries such as TensorFlow, Keras and PyTorch with conda package manger. CUDA version is currently 11.4 which need to be the same with drivers and thus can't be changed. Tensorflow library compatibility is available at: https://www.tensorflow.org/install/source#gpu.
Using conda
Code Block |
---|
language | bash |
---|
title | Conda installation |
---|
|
# install miniforge (or any anaconda manager)
$ wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
# make it executable
$ chmod +x Miniforge3-Linux-x86_64.sh
# run and install the executable
$ ./Miniforge3-Linux-x86_64.sh |
...
Code Block |
---|
language | bash |
---|
title | Library installations |
---|
|
# create a conda environment called ML with Python 3.8
$ conda create -n ML python=3.8
# activate the environment
$ conda activate ML
# install packages, note that installing tensorflow-gpu and keras also installs many number of extra libraries such as CUDA toolkit, cuDNN (CUDA Deep Neural Network library), Numpy, Scipy, Pillow
(ML) $ conda install tensorflow-gpu keras
# (OPTIONAL) cudatoolkit is installed automatically while installing keras and tensorflow-gpu, but if you need a specific (or latest) version run below command.
(ML) $ conda install -c anaconda cudatoolkit
# (OPTIONAL) installing pytorch GPU, pytorch might need cuda 11.8
(ML) $ conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia |
Installation Confirmations
Code Block |
---|
language | bash |
---|
title | Check python version |
---|
|
(ML) $ python3 --version
Python 3.8.18 |
...