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

如何设置device设备号? #29

Open
David-19940718 opened this issue Mar 7, 2024 · 3 comments
Open

如何设置device设备号? #29

David-19940718 opened this issue Mar 7, 2024 · 3 comments

Comments

@David-19940718
Copy link

您好,很感谢您的出色工作!

现在服务器有多张卡,请问是否支持每张卡跑一个程序,我想并发推理,这个要如何如设置?

@shenyunhang
Copy link
Owner

感谢您的关注!

如果是用demo/demo_lazy.py进行推理,有两种方法并发

  1. 第一种是把这一行改成

    demo = VisualizationDemo(cfg, parallel=True, args=args)
    
  2. 第二种是设置CUDA_VISIBLE_DEVICES

    CUDA_VISIBLE_DEVICES=0 python3.9 demo/demo_lazy.py ...
    
    CUDA_VISIBLE_DEVICES=1 python3.9 demo/demo_lazy.py ...
    
    CUDA_VISIBLE_DEVICES=2 python3.9 demo/demo_lazy.py ...
    ....
    

@SilenceWinter
Copy link

SilenceWinter commented Apr 15, 2024

感谢您的关注!

如果是用demo/demo_lazy.py进行推理,有两种方法并发

  1. 第一种是把这一行改成
    demo = VisualizationDemo(cfg, parallel=True, args=args)
    
  2. 第二种是设置CUDA_VISIBLE_DEVICES
    CUDA_VISIBLE_DEVICES=0 python3.9 demo/demo_lazy.py ...
    
    CUDA_VISIBLE_DEVICES=1 python3.9 demo/demo_lazy.py ...
    
    CUDA_VISIBLE_DEVICES=2 python3.9 demo/demo_lazy.py ...
    ....
    

请问,预测阶段,如果两块3090GPU分别加载一个VisualizationDemo模型,同时启动,这种情况,怎么改 demo/demo_lazy.py?
我在demo/demo_lazy.py中,增加了 cfg.train.device = "cuda:1" ,让一个模型加载到第二块GPU,但是遇到报错如下
RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling `cublasLtMatmul( ltHandle, computeDesc.descriptor(), &alpha_val......

@shenyunhang
Copy link
Owner

有可能是一些参数或者数据不在同一个卡上导致的。

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

3 participants