Conda on AI.Panther (Miniforge)

Overview

Conda allows you to create isolated software environments in your home directory. On AI.Panther, this is commonly done using Miniforge, a lightweight conda distribution based on conda-forge. Conda environments can be created and used on both login nodes and compute nodes, thought the login node should only be used for very lightweight installs. Some packages (especially GPU-enabled packages) must be installed on a compute node.

Installing Miniforge (Linux)

From the login node:

cd ~
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh
  • Accept the license
  • Use the default install location (~/miniforge3)

  • Allow shell initialization when prompted

After installation, start a new shell or run:

source ~/.bashrc

Verify:

conda --version

Source: https://github.com/conda-forge/miniforge

Creating and Using an Environment

Create an environment:

conda create -n myenv python=3.13 -y
conda activate myenv
python --version

Install packages:

conda install -c conda-forge numpy scipy -y

Deactivate when finished:

conda deactivate

Installing Packages on Compute Nodes

Some packages - particularly those that:

  • Require GPUs

  • Build CUDA extensions

  • Perform heavy compilation

should be installed on a compute node, not the login node.

Interactive install on a compute node

srun -p gpu1 --nodes=1 --ntasks=1 --mem=10G --time=01:00:00 --pty bash -l

Then activate conda and install:

conda activate myenv
conda install -c conda-forge <package>

Installing from an environment file (recommended for complex setups)

If you have an environment.yml:

srun --partition=short mamba env create -y --file environment.yml

Notes:

  • This ensures the environment is built under Slurm resource limits

  • mamba is faster and recommended for larger dependency graphs

  • The environment will be created in your conda installation


Best Practices

  • Use the login node for:

    • Creating environments

    • Light installs

    • Managing environment files

  • Use compute nodes for:

    • GPU-enabled packages

    • Large or long installs

  • Keep one environment per project when possible