Thanks to visit codestin.com
Credit goes to github.com

Skip to content

关于 streamer = Streamer(... cuda_devices=(0,1,2,3))时,gpu 0不被使用的问题 #91

@WuZifan

Description

@WuZifan

当我按照教程去跑multi gpus的服务时,发现我的服务能够很好的在gpu 1,2,3上启动,但是无法在gpu 0 上进行启动。

调研后,发现在
managed_model.py 这个文件中,有一个设置cuda_visiable_device的方法:

@staticmethod
    def set_gpu_id(gpu_id=None):
        if gpu_id:
            os.environ["CUDA_VISIBLE_DEVICES"] = str(gpu_id)

注意这里的if 的判断条件,当gpu_id =0 时,也会被认为条件失败,从而不设置cuda;
因此,需要手动将其修改为 if gpu_id is not None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions