Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
First-Class GPU Resource Management: Device Drivers, Runtimes, and CUDA Compilers for Nouveau.
C C++ Other
Branch: gdev-port
Pull request Compare This branch is 149 commits ahead, 537 commits behind master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
bench
common
cuda
driver
lib
test
trace
util
README

README

#
# Gdev - Managing GPUs as First-Class Computing Resources
# 
# README
#
# Copyright (C) 2011 Shinpei Kato
# University of California, Santa Cruz
# Systems Research Lab.
# 
# All Rights Reserved.
#

Gdev is a runtime-unified operating system module that manages GPUs 
as first-class computing resources.
Currently it supports only NVIDIA's Fermi GPUs, but the concept of
Gdev is also applicable to generic "compute devices".
Gdev coordinates with a DRM-based GPU device driver (pscnv/nouveau)
in the operating system, providing APIs for application programs.
Gdev API is a low-level primitive that allows programmers to control
the details of GPU resource parameters, while Gdev also supports a
high-level API, such as CUDA.
Gdev is available for GPGPU and graphics applications. It is self-
contained for GPGPU, though graphics applications require additional
APIs, such as OpenGL, LIBDRM, and DDX.

Gdev is open-source. We believe that this open-source implementation
facilitates further research and development of GPU technology.

The following instruct Gdev installation. Some of the installation
stages will require you to install additional tools and packages.
$(TOPDIR) will represent your top working directory, henceforth.

1. Download

cd $(TOPDIR)
git clone git://0x04.net/envytools.git
git clone git://github.com/shinpei0208/pscnv.git
git clone git://github.com/shinpei0208/gdev.git

2. envytools

envytools is a rich set of open-source tools to compile or decompile
NVIDIA GPU program code, firmware code, macro code, and so on. It is
also used to generate C header files with GPU command definitions.
In addition, envytools document the NVIDIA GPU architecture details,
while are not disclosed to the public so far. If you are interested 
in GPU system software development, this is what you should read!
Please follow the instruction below to install envytools.

cd $(TOPDIR)/envytools
mkdir build
cd build
cmake .. # may require some packages on your distro
make
sudo make install # will install tools to /usr/local/{bin,lib}

3. Device Driver

Recent versions of Gdev disgregate from the device driver. You need
to install some GPU device driver underlying Gdev. Currently there
are two open-source drivers available in Linux: pscnv and nouveau.
The following shows how to install pscnv.
NOTE: pscnv is PathScale's open-source driver, but we have applied
several patches to make it available to work with Gdev.

cd $(TOPDIR)/pscnv/pscnv
./configure
make
sudo init 3 # kill X
sudo make modules_install
sudo shutdown -r now # will reboot your machine

4. Gdev Module

Gdev is double-edge, i.e., it provides a runtime-unified operating
system approach as well as a typical user-space runtime approach.
The following installation is required only for the former.

cd $(TOPDIR)/gdev/driver
mkdir build
cd build
../configure
make
sudo insmod gdev.ko
sh gdev.sh

5. Gdev Library

Gdev's user-space library provides Gdev API. This API can be used
by either user programs directly or another high-level API library.
For instance, third party's CUDA library can use Gdev API.
If you have taken Step 4, i.e., chosen the runtime-unified operating
system approach, this library is just a set of wrapper functions
that call Gdev module's functions via ioctl.

cd $(TOPDIR)/gdev/lib
mkdir build
cd build
../configure # if you skipped Step 4, you must specify --target=user
make
sudo make install
export LD_LIBRARY_PATH="/usr/local/gdev/lib64:$LD_LIBRARY_PATH"
export PATH="/usr/local/gdev/bin:$PATH"

6. CUDA Driver API

Gdev currently supports a limited set of CUDA Driver API. We plan to 
support a full set of CUDA Driver API in future work. If you need
CUDA Runtime API, you should use some compiler framework, such as
Ocelot, which can translate CUDA Drier API to Runtime API.

cd $(TOPDIR)/gdev/cuda
mkdir build
cd build
../configure # if you want to run CUDA in OS, specify --target=kcuda
make
sudo make install

7. CUDA Driver API test (user-space programs)

cd $(TOPDIR)/test/cuda/user/madd
make
./user_test 256 # a[256] x b[256] = c[256]

Something went wrong with that request. Please try again.