How to avoid slowdown with 25-30 students running simple GPU kernels on 4 GeForce GTX 650 Ti s?
You need nvidia-docker. If your ssh server is in a Docker instance, you can assign each one to a different GPU. Then just set things up so only one team is sshing into each Docker instance. You don't need to do anything fancy with cudaSetDevice(), or risk students using the wrong device and messing things up for others, because each instance looks like it only has one GPU.