To schedule a job on a GPU enable node, add the following line to the parameters section of your qsub submission script: #$ -l gpu=1
Using a GPU from a qlogin session
To qlogin to a GPU enabled node: qlogin -l gpu=1
You will then be able to use the GPU from an interactive session such as Jupyter notebook.
Running Code On The GPU
Ensure that you are using the new conda environment: source activate shark-gpu
Your python code needs to specify which of the GPU cards on a specific node should be used.
The setGPU module automates this process. Adding the line import setGPU
to the imports section of your python script will automatically select a free GPU node and use it for computation.
You should see a message such as setGPU: Setting GPU to: 0
in your program output which tells you that the GPU in slot 0 has been selected.
Any GPU specific code will now be run on this GPU.