Giter Site home page Giter Site logo

vingorilla / gpunet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ut-osa/gpunet

0.0 3.0 0.0 395 KB

GPUnet is a native GPU networking layer that provides a socket abstraction over Infiniband to GPU programs for NVIDIA GPUs.

License: Other

C 76.95% C++ 8.67% Cuda 13.49% Shell 0.61% JavaScript 0.29%

gpunet's Introduction

GPUnet

GPUnet is a native GPU networking layer that provides a reliable stream abstraction over Infiniband and high-level socket APIs to GPU programs for NVIDIA GPUs.

GPUnet enables threads or threadblocks in one GPU to communicate with threads in other GPUs or CPUs via standard and familiar socket interfaces, regardless of whether they are in the same or different machines.

GPUnet uses Peer-to-Peer DMA (via GPUDirectRDMA) to place and manage network buffers of a GPU application directly in GPU memory.

Code example

This is a code example of a simple (working) GPU echo client.

Note that the GPU socket API is threadblock-cooperative, meaning that all the threads in the threadblock are required to call the same function with the same parameters at the same point in a program.

__global__ void gpuclient(struct sockaddr_in *addr, int* tb_alloc_tbl, int nr_tb) {
  __shared__ int sock;
  __shared__ uchar buf[BUF_SIZE];
  int ret, i;

  while ((sock = gconnect_in(addr)) < 0) {};
  assert(sock >= 0);

  for (i = 0; i < NR_MSG; i++) {
    int recved = 0, sent = 0;

    do {
      ret = gsend(sock, buf + sent, BUF_SIZE - sent);
      if (ret < 0) {
        goto out;
      } else {
        sent += ret;
      }
    } while (sent < BUF_SIZE);
    
    __syncthreads(); 
  
    do {
      ret = grecv(sock, buf + recved, BUF_SIZE - recved);
      if (ret < 0) {
        goto out;
      } else {
        recved += ret;
      }
    } while (recved < BUF_SIZE);
    
    __syncthreads();
  }

  out:
  BEGIN_SINGLE_THREAD_PART {
      single_thread_gclose(sock);
  } END_SINGLE_THREAD_PART;
}

Prerequisites

  • CUDA 5.5
  • CUDA driver 331.38 or higher
  • Mellanox OFED 2.0
  • Our modules are tested on CentOS 6.5.

To figure out any issues with configuration, you can run utils/diagnose.sh.

Compilation

Before compiling, please add your GPU and CUDA compilation option to the bottom case statements of utils/nvcc_option_gen.sh. Adding an entry significantly reduces compilation time.

For compilation of gpunet, rsocket for GPUnet needs to be installed first. It is located under core/rsocket. There, execute the following:

./osa_config.sh; make; make install

Then we need the gpu_usermap driver. Its location is under core/gpu_usermap. Similar make and make install will do the job.

You can then compile the GPUnet library by running make under the core directory.

Test application

You can use applications in apps/microbenchmark for testing.

gpunet's People

Contributors

sangmank avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.