https://github.com/a-nau/python-cuda-envs
Script to automatically map a specific CUDA version to a Conda Python environment.
https://github.com/a-nau/python-cuda-envs
anaconda anaconda-environment cuda installation installation-script python python-environment python3
Last synced: 6 months ago
JSON representation
Script to automatically map a specific CUDA version to a Conda Python environment.
- Host: GitHub
- URL: https://github.com/a-nau/python-cuda-envs
- Owner: a-nau
- License: mit
- Created: 2022-07-15T13:39:39.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-15T14:24:00.000Z (over 3 years ago)
- Last Synced: 2023-03-06T13:33:44.116Z (about 3 years ago)
- Topics: anaconda, anaconda-environment, cuda, installation, installation-script, python, python-environment, python3
- Language: Shell
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/pytorch/pytorch), [PyTorch3D](https://github.com/facebookresearch/pytorch3d) and [Detectron2](https://github.com/facebookresearch/detectron2).
## Usage
Install environment from the root directory using
```shell
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](pytorch3d/install_environment.sh)
```shell
#!/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](pytorch3d/environment_check.sh) if all crucial libraries are imported correctly.
**Note**
- The default CUDA installation path is `/usr/local/`, you can change it [here](utils/activate.sh#L8) (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](utils/copy_activation_files.sh#L3) (Line 3).