Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent two CUDA programs from interfering

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.

Is there a way to get a lock on the GPU so other programs can't interfere while it's running?

Edit

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.

like image 537
Barry Brown Avatar asked Dec 16 '12 09:12

Barry Brown


1 Answers

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.

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.

like image 153
talonmies Avatar answered Sep 28 '22 08:09

talonmies