A procedure that includes the following: Receiving (302), in a computer
system (100) containing one or more
graphics processing units, GPUs (110, 112, 114), wherein the one or more GPUs (110, 112, 114) provide the simultaneous
processing of a plurality of jobs by a plurality of virtual GPUs, vGPUs (116, 118, 120), a request to schedule a new job to be executed by the computer
system (100); in response to receiving the request: Determining a number of job assignments to assign a number of jobs to the plurality of vGPUs (116, 118, 120) that minimize a cost function which includes a component for the operating costs of the GPU (110, 112, 114) and a component for job migration costs, wherein the number of jobs includes the new job and one or more existing jobs that have already been previously assigned to the plurality of vGPUs (116, 118, 120); Assignment (304) of the new task to one or more vGPUs (116, 118, 120) from the plurality of vGPUs (116, 118, 120) according to the specified number of assignments; Update (306) the assignments of existing jobs to one or more vGPUs (116, 118, 120) from the plurality of vGPUs (116, 118, 120) according to the specified number of assignments; and
Processing of the new order and existing orders by one or more GPUs (110, 112, 114) in the computer
system (100); where determining the number of allocations that minimize the cost function involves minimizing (308) the cost function subject to the following constraints: The number of jobs assigned to a GPU (110, 112, 114) cannot be greater than the capacity of the GPU (110, 112, 114); The new job can only be scheduled on one GPU (110, 112, 114); and The migration of an order is carried out when a new assignment of an existing order differs from a current assignment of an existing order.