def set_nvidia_environment_variables(environment, gpu_ids):
    """
    Updates a dictionary containing environment variables to setup Nvidia-GPUs.

    :param environment: The environment variables to update
    :param gpu_ids: A list of GPU ids
    """
    if gpu_ids:
        nvidia_visible_devices = ','.join(map(str, gpu_ids))
        environment['NVIDIA_VISIBLE_DEVICES'] = nvidia_visible_devices
