- Load singularity module:
module load singularity/2.4.4
-
Download and unzip StarCraft II for Linux: here I take
StarCraft II 3.16
for example, you could replace the link and zip file name according to SC2 Official Linux Downloads- Download zip
wget http://blzdistsc2-a.akamaihd.net/Linux/SC2.3.16.1.zip
- Unzip
unzip SC2.3.16.1.zip
- Prompt the password
iagreetotheeula
- Move StarCraft II files
mv ./StarCraftII/ $SCRATCH/StarCraftII
-
Download and unzip StarCraft II mini maps
- Download mini game maps
wget https://github.com/deepmind/pysc2/releases/download/v1.2/mini_games.zip
- Unzip
unzip mini_games.zip
- Move mini game maps
mv ./mini_games $SCRATCH/StarCraftII/Maps/
-
Start the Ubuntu container
singularity shell --nv /beegfs/work/public/singularity/ubuntu-17.10.img
-
Create and activate virtual environment
- Create virtual environment named
py3tf
virtualenv -p python3 $SCRATCH/py3tf
- Activate virtual environment
py3tf
source $SCRATCH/py3tf/bin/activate
- Create virtual environment named
-
Add python dependencies in virtual environment
- Install tensorflow-gpu
pip install tensorflow-gpu
- Install pysc2
pip install pysc2
3. (Optional) Install other dependencies defined in
requirements.txt
pip install -r requirements.txt
-
Deactivate virtual environment, exit the container and return to login node
- Deactivate virtual environment
deactivate
- Exit container
exit
- Download the model you wanna train, I take this one for example
- Download
git clone https://github.com/simonmeister/pysc2-rl-agents
- Move
mv pysc2-rl-agents $SCRATCH/
- Download
slurm
scripts- Download and move control code(you should modify the
notification email address
): modify code as you see fit(references1,2)
wget https://gist.github.com/jimmyahacker/1bb8b99b58a9d2af1ca8582f9f8d14dc/raw/d5e5d2a71ebfaa3a18e938c6e58baf127ad57bca/job.s;mv job.s $SCRATCH/
- Download and move in-container code
wget https://gist.github.com/jimmyahacker/1bb8b99b58a9d2af1ca8582f9f8d14dc/raw/d5e5d2a71ebfaa3a18e938c6e58baf127ad57bca/in_container.sh; mv in_container.sh $SCRATCH/
- Download and move control code(you should modify the
- Run in batch mode
cd $SCRATCH;sbatch job.s
- See job status
squeue -u $USER
-
Download
allocate_gpus.sh
written below- Download
wget https://gist.github.com/jimmyahacker/1bb8b99b58a9d2af1ca8582f9f8d14dc/raw/d11fa4148bb506103b08a2b44fe06247fb1f472b/allocate_gpus.sh
- Move to home directory
mv ./allocate_gpus.sh $SCRATCH/allocate_gpus.sh
-
Load packages and allocate GPUs: allocate 1 GPU(you could replace 1 with any number of GPUs you wanna allocate)
source $SCRATCH/allocate_gpus.sh 1
- Start the Ubuntu container
singularity shell --nv /beegfs/work/public/singularity/ubuntu-17.10.img
- Run virtual environment
py3tf
source $SCRATCH/py3tf/bin/activate
- Set StarCraftII environment variable
export SC2PATH="$SCRATCH/StarCraftII"
Requirements
PySC2 Old version
used in here