-
Notifications
You must be signed in to change notification settings - Fork 87
Guide to GPUDrive setup on NYU HPC
Clone the gpudrive repository into your /home/$USER directory (info on HPC directories and data management).
git clone --recursive https://github.com/Emerge-Lab/gpudrive.gitMove into the cloned repository folder:
cd gpudrive- Create a directory for overlay files:
mkdir -p /home/$USER/gpudrive/integrations/hpc
cd /home/$USER/gpudrive/integrations/hpc- Copy and decompress the overlay image:
cp /scratch/work/public/overlay-fs-ext3/overlay-10GB-400K.ext3.gz .
gunzip overlay-10GB-400K.ext3.gzThis may take a couple of minutes, depending on the size of the overlay image.
Note: Other overlay images should work fine as well.
-
- Verify the decompressed overlay image exists:
ls /home/$USER/gpudrive/integrations/hpcRun the following to start the container with GPU support and the overlay image:
cd ../..singularity exec --nv --overlay /home/$USER/gpudrive/integrations/hpc/overlay-10GB-400K.ext3:rw \
/scratch/work/public/singularity/cuda12.2.2-cudnn8.9.4-devel-ubuntu22.04.3.sif /bin/bashyou will see:
Singularity> Details on Sinularity and overlay images on NYU HPC here.
srun --nodes=1 --tasks-per-node=1 --cpus-per-task=1 --mem=10GB --gres=gpu:1 \
--time=1:00:00 --account=<ASK> --pty /bin/bashOuput:
>>> srun: job 55367179 queued and waiting for resources
>>> srun: job 55367179 has been allocated resourcesYou will see something like:
[08:33:52 Wed Dec 25 2024] username@ga021.hpc.nyu.edu ~/gpudriveAsk Eugene for your account code.
-
Inside the Singularity container, create a virtual environment:
-
One-off step: Create conda environment with Python 3.10
conda create --name gpudrive python=3.10Why use conda? Because currently, the only way to use a Python version > 3.8.6 on the cluster without Docker is with conda.
- Activate conda environment conda activate gpudrive
Now you will see:
(/scratch/username/.conda/gpudrive) Singularity>We use the manual install option to set up GPUDrive, see the readme for details.
- Build C++ codebase:
Inside the
gpudrivefolder, run:
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j 32 # cores to build with, e.g. 32
cd ..if successful, you'll see
[100%] Linking CXX executable my_tests
[100%] Built target my_tests- Setup Python components
pip install -e . # Launch Python
python3
# Check GPUDrive import
>>> import gpudriveIf there are no errors, the installation is successful!
- Request an interactive compute node, e.g:
srun --nodes=1 --tasks-per-node=1 --cpus-per-task=1 --mem=10GB --gres=gpu:1 \
--time=1:00:00 --account=<account_number> --pty /bin/bashReplace <account_number> with the your project number.
- Navigate to repository:
cd /home/$USER/gpudrive- Launch the Singularity image:
singularity exec --nv --overlay /home/$USER/gpudrive/integrations/hpc/overlay-10GB-400K.ext3:rw \
/scratch/work/public/singularity/cuda12.2.2-cudnn8.9.4-devel-ubuntu22.04.3.sif /bin/bash- Activate the virtual environment:
conda activate gpudrive - Run experiments!
e.g.,
python baselines/ippo/ippo_pufferlib.py-
Define run configurations and hyperparameters to sweep over in
generate_sbatch.pyand run it. This stores ansbatchscript for you inLOG_FOLDER. -
Submit the jobs using
sbatch hpc/run_scripts/<your_file>.sh