def processes_filter_by_gpu(gpu, all_procs):
    """
    Filter processes across all gpus (from nvidia_gpu_query.gpus())
    to processes belonging to just <gpu>.
    """
    # Limit processes to the provided gpu.
    gpu_procs = []
    for gpu_proc in all_procs:
        # NOTE: gpu_uuid is a unique identifier for the physical card.
        # We can use this to differentiate between the same model of card.
        if gpu_proc['gpu_uuid'] == gpu['uuid']:
            gpu_procs.append(gpu_proc)
    return gpu_procs