Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
WuZifan opened this issue Nov 11, 2021 · 0 comments

Comments

@WuZifan
Copy link

WuZifan commented Nov 11, 2021

当我按照教程去跑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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant