Skip to content

Ubuntu 20 & 22 with GPU

Peter Leonard edited this page Nov 2, 2022 · 1 revision
  1. Since Ubuntu 20 and 22 ship with NVIDIA's proprietary binary display drivers, the installation is a bit simpler than earlier versions. Ensure you tick the box allowing for Third-Party Software during the OS installation.

  2. Install anaconda.

  3. Create a new environment for pixplot:

conda create --name pixplot python=3.7

conda activate pixplot

  1. We'll install an environment-specific version of cudatoolkit, and an accompanying version of CUDNN via Anaconda This won't harm your main Ubuntu operating system.

conda install cudatoolkit=11

conda install -c anaconda cudnn

  1. Install pixplot and supporting packages:

pip install https://github.com/yaledhlab/pix-plot/archive/master.zip

pip install image_datasets (a helper utility to easily grab pixplot-ready datasets)

  1. Get a sample dataset:

python

import image_datasets

image_datasets.oslomini.download()

(now exit python via quit() or CTRL+D)

  1. Test the installation:

time pixplot --images="datasets/oslomini/images/*.jpg" --metadata="datasets/oslomini/metadata/metadata.csv" --shuffle

In another terminal window, you can run watch -n 0.1 nvidia-smi to monitor how TensorFlow uses your GPU.

Optional: Installing HDBScan

sudo apt install build-essential

pip install hdbscan

pip install numpy==1.20 (pip may complain this is incompatible with Tensorflow, but it seems to work fine, at least with Tensorflow 2.5)