5. Example submission script
Below is an example submission script you can cut and paste into a script on your previously created /vol/bitbucket/${USER} folder.
IMPORTANT: This example assumes you have followed the previous steps and installed a python environment as directed.
- Edit the paths if you have your own python environment, or if you already load your environment in ~/.bashrc.
- Do not remove # signs, keep them as below, make sure the #SBATCH directives are directly after #!/bin/bash
#!/bin/bash
#SBATCH --gres=gpu:1
#SBATCH --mail-type=ALL # required to send email notifcations
#SBATCH --mail-user=${USER} # required to send email notifcations - alternatively specifiy an email addresss instead of '${USER}'
export PATH=/vol/bitbucket/${USER}/myvenv/bin/:$PATH
# the above path could also point to a miniconda install
# if using miniconda, uncomment the below line
# source ~/.bashrc
source activate
source /vol/cuda/12.0.0/setup.sh
/usr/bin/nvidia-smi
uptime
Remember to make your script executable (run this command in a shell, do not include it in your script):
chmod +x myscript.sh
Please note, whenever your job is submitted, any environment variables from ~/.bashrc or ~/.cshrc are also loaded, meaning your scripts are run in the context of your user profile. Your script can access your own home directory, your /vol/bitbucket folder or shared volumes such as /vol/cuda