a-nau / python-cuda-envs

Script to automatically map a specific CUDA version to a Conda Python environment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Environments for Deep Learning

Having specific (and varying) CUDA version for your Python environments can be tricky. Conda allows you to do just that and this install script automatizes the process for you.

We exemplarily show how to use the script with CUDA 11.1 and install PyTorch, PyTorch3D and Detectron2.

Usage

Install environment from the root directory using

source pytorch3d/install_environment.sh

You can configure the following easily

  • name of the conda environment
  • CUDA version you want to use
  • Python version

in the install_environment.sh

#!/bin/bash

# Configuration
env_name=pytorch3d                         # set environment name here
custom_cuda_version=cuda-11.1              # set CUDA version here

# Setting up basic conda environment
conda activate base
conda env remove --name ${env_name}
conda create -y -n ${env_name} python=3.9  # set Python version here
[...]

After install perform an automated check if all crucial libraries are imported correctly.

Note

  • The default CUDA installation path is /usr/local/, you can change it here (Line 8). The final CUDA path that is linked is then /user/local/{custom_cuda_version}.
  • The default conda envs path is ~/anaconda3/envs, you can change it here (Line 3).

About

Script to automatically map a specific CUDA version to a Conda Python environment.

License:MIT License


Languages

Language:Shell 100.0%