如何防止两个CUDA程序相互干扰 [英] How to prevent two CUDA programs from interfering
问题描述
我注意到,如果两个用户尝试同时运行CUDA程序,则它倾向于锁定卡或驱动程序(或同时锁定两者).我们需要重置卡或重新启动计算机以恢复正常行为.
I've noticed that if two users try to run CUDA programs at the same time, it tends to lock up either the card or the driver (or both?). We need to either reset the card or reboot the machine to restore normal behavior.
有没有办法锁定GPU,以便其他程序在运行时不会受到干扰?
Is there a way to get a lock on the GPU so other programs can't interfere while it's running?
OS是在服务器上运行的Ubuntu 11.10.没有运行X Windows时,该卡用于显示文本系统控制台.有多个用户.
OS is Ubuntu 11.10 running on a server. While there is no X Windows running, the card is used to display the text system console. There are multiple users.
推荐答案
如果您使用TCC驱动程序在Linux或Windows上运行,则可以使用
If you are running on either Linux or Windows with the TCC driver, you can put the GPU into compute exclusive mode using the nvidia-smi
utility.
计算独占模式使驱动程序拒绝上下文建立请求,前提是另一个进程已经在该GPU上保留了上下文.任何尝试在繁忙的计算专用GPU上运行的进程都将收到无设备可用错误并失败.
Compute exclusive mode makes the driver refuse a context establishment request if another process already holds a context on that GPU. Any process trying to run on a busy compute exclusive GPU will receive a no device available error and fail.
这篇关于如何防止两个CUDA程序相互干扰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!