Interfacing Intel InfiniBand with NVIDIA GPUs

-----------------------------------------------------------------------------
Introduction
-----------------------------------------------------------------------------

This package provides information on how to setup and test that two 
drivers -- the Intel InfiniBand driver
(qib) and the NVIDIA GPU driver -- can share pinned memory pages for optimal
performance.

If you are running on any Linux distribution supported by this Intel
InfiniBand software release, then you must use NVIDIA CUDA 4.0 or newer to
have a supported solution from NVIDIA.  To get optimal performance with the
qib InfiniBand driver in this software release in applications which CUDA 4.x,
all you need to do is to set the environment variable:
   CUDA_NIC_INTEROP=1
and to propagate that variable to the compute nodes running the application.
   
---------------------------------------
CONTENTS

- README.txt       - This file                     
                     
- mpi_pinned.c     - A small test program that can verify if the
                     installation was successful.
- Makefile         - File to enable easy build of two test programs
                     from mpi_pinned.c

---------------------------------------

Note:  

In previous Intel IFS releases, NVIDIA support required a patch to the CUDA
3.1 or 3.2 driver.  This patch is not needed when using IFS 7.1 and CUDA 4.0
or higher, so the patch is no longer included.



------------------------------------------------
CUDA Toolkit and mpi_pinned.c test program 
------------------------------------------------

To build the mpi_pinned test program, follow these two steps 

3. Download and install the CUDA Toolkit for your Linux distribution.

4. Build and run the mpi_pinned.c program included in this distribution


More details  on step 4 below.

3. After installing the CUDA Toolkit for your Linux distribution: 

   - Please make sure your LD_LIBRARY_PATH includes /usr/local/cuda/lib64
   - Please make sure your PATH includes /usr/local/cuda/bin

4. Put the mpi_pinned.c and Makefile from this distribution in a work directory.

mpi_pinned.c is a sample code from NVIDIA that can be used to demonstrate that
this installation process was successful in that the Intel InfiniBand driver
and the NVIDIA GPU driver can share pinned memory.

After using mpi-selector (or other method) to choose a MPI to use, and to get
mpicc in your path, you can simply type:
  make
to compile both the version with pageable memory ( the one that works without
this software) named mpi_pageable; and the version with pinned memory ( the one
that will test whether this installation was successful) named mpi_pinned.

The mpi_pinned or mpi_pageable programs are expecting 2 nodes, each with a
CUDA-capable card.

Example commands* to run these programs are:

  mpirun -np 2 -H host1,host2 -x CUDA_NIC_INTEROP=1 ./mpi_pinned
or
  mpirun -np 2 -H host1,host2 ./mpi_pageable

* These commands should work with Open MPI.  Other MPIs may
  need differing syntax, i.e.:  mpirun_rsh.
  This program is designed to work only with "-np 2" on two hosts.

Both programs should work, but the mpi_pinned program should result in better
bandwidth results for both the GPU-to-host transfers and for the transfer
between nodes using MPI.


