找到了救命的东西 NVIDIA MPS (multi-process service)

 Available since CUDA 5.5

 Formerly known as CUDA Proxy

 Allows multiple CUDA processes to share a single GPU context

 Pre-CUDA 4.0 APIs are not supported

 Requirements

 Unified Virtual Address (UVA)

 x86-64

 Compute capability - 3.5 or higher

  1. MPS is not required to use MPI

  2. If you don't use MPS, but you launch multiple MPI ranks per node (i.e. per GPU), then if you have the compute mode set to default, then your GPU activity will serialize. If you have your compute mode set to EXCLUSIVE_PROCESS or EXCLUSIVE_THREAD, you'll get errors when multiple MPI ranks attempt to use a single GPU.

  3. do I have to launch MPS-daemon before my application will launched, or do I have to launch MPS-daemon from my application, or MPS-daemon will started automatically when I have launched my app? 

    You must launch the daemon before your run.You may want to read the documentation in particular section 4.1.2 

The necessary instructions are contained in the documentation for the MPS service. You'll note that those instructions don't really depend on or call out MPI, so there really isn't anything MPI-specific about them.

Here's a walkthrough/example.

  1. Read section 2.3 of the above-linked documentation for various requirements and restrictions. I recommend using CUDA 7, 7.5, or later for this. There were some configuration differences with prior versions of CUDA MPS that I won't cover here. Also, I'll demonstrate just using a single server/single GPU. The machine I am using for test is a CentOS 6.2 node using a K40c (cc3.5/Kepler) GPU, with CUDA 7.0. There are other GPUs in the node. In my case, the CUDA enumeration order places my K40c at device 0, but the nvidia-smi enumeration order happens to place it as id 2 in the order. All of these details matter in a system with multiple GPUs, impacting the scripts given below.

链接中有例子,说明如何使用 Nvidia MPS

http://stackoverflow.com/questions/34709749/how-do-i-use-nvidia-multi-process-service-mps-to-run-multiple-non-mpi-cuda-app

http://on-demand.gputechconf.com/gtc/2015/presentation/S5584-Priyanka-Sah.pdf

问题是,

1、如何运行 MPS? 有没有一个流程,比如 hello world?

2、Jcuda里面有没有?如果有,怎么用?万一没有,怎么办

原文地址:https://www.cnblogs.com/xingzifei/p/6135472.html