PBS Single exection host run job using cpu include gpu

Please create a ngpus host-level resource and configure the node as below

  1. qmgr -c “create resource ngpus type=long,flag=nh”
  2. Add ngpus to the resources: line of the $PBS_HOME/sched_priv/sched_config file
    eg: resources: “ncpus, aoe, …,ngpus”
  3. kill -HUP
  4. qmgr -c “set node NODENAME resources_available.ngpus=1”
    NODENAME = replace with your compute node hostname
    Here, i have assigned it to 1 , it means one gpu card, if you have more assign accordingly

Please note defining and requesting resources via qsub in PBS Pro helps scheduling of jobs on to the compute nodes ( requests – matchmaking – on to available resources at that time) . PBS Pro does not enforce the underlying applications to use 1 ncpu and 1 ngpu. The application that you use, should be capable of utilizing both cpu(s) and gpu(s). The request statement via qsub is to help PBS Pro what kind of resource your job requires to run and PBS Pro searches such resources in your cluster and schedules job on to them.

Note:

qsub -l select=1:ncpus=1 - - /path/to/myapplication/runprogram -np 1 -ngpus 1 -input inputfile.fem
Here i have not requested the gpu, but in the application batch command line, i have asked the application to use the GPU. PBS Pro would still run this job and the application can utilise gpu(s).
Here PBS Pro does not know whether this job has occupied the gpu on that node.

qsub -l select=1:ncpus=1:ngpus=1 - - /path/to/myapplication/runprogram -np 1 -ngpus 1 -input inputfile.fem
Here PBS Pro knows , that this request running on the node is using that gpu, so any further request of this gpu will put the job in the queue, until this job is finished.