Parent Node:
Code Snippet Name Code Snippet Description Parent Node
Pixel Buffer Objects: Mixing CUDA and OpenGL within the same application

Following is the source for the Doctor Dobb's Journal article Part 15 Using Pixel Buffer Objects with CUDA and OpenGL. This source includes Microsoft Visual Studio build files as well as a Linux command-line to build an executable.

Many thanks to Joe Stam at NVIDIA for providing the Visual Studio build files. Joe also notes you need to remove the following lines from perlinKernelPBO.cu:

#include <cutil_gl_inline.h>

#include <cuda_gl_interop.h>

 

Using Vertex Buffer Objects with CUDA and very fast surface rendering with primitive restart

Following is the source for the Doctor Dobb's Journal article for a future article entitled Using Vertex Buffer Objects with CUDA and OpenGL. This source includes Microsoft Visual Studio build files as well as a Linux command-line to build an executable.

This code demonstrates how to draw 3D points, wireframe and surfaces using the framework described in Part 15 of my Doctor Dobb's article Using Pixel Buffer Objects with CUDA and OpenGL. I left in some ifdef statements so you can verify for yourself the speed of using Primitive Restart to bypass PCI bus bandwidth limitations.

Many thanks to Joe Stam at NVIDIA for providing the Visual Studio build files. Joe also notes you need to remove the following lines from perlinKernelVBO.cu and change the uint variable in runCUDA to "unsigned int":

#include <cutil_gl_inline.h>

#include <cuda_gl_interop.h>

 

Multiclass Support Vector Machine

 The scaling of serial algorithms cannot rely on the improvement of CPUs anymore. The performance of classical Support Vector Machine (SVM) implementations has reached its limit and the arrival of the multi core era requires these algorithms to adapt to a new parallel scenario. Graphics Processing Units (GPU) have arisen as high performance platforms to implement data parallel algorithms. In this project, it is described how a naïve implementation of a multiclass classifier based on SVMs can map its inherent degrees of parallelism to the GPU programming model and efficiently use its computational throughput. Empirical results show that the training and classification time of the algorithm can be reduced an order of magnitude compared to a classical solver, LIBSVM, while guaranteeing the same accuracy.

Please find attached the multisvm 2.0 release of the source code.

The link to the source code repository where future versions will be available is http://code.google.com/p/multisvm/

* Sample datasets were removed due to their large file size. These can be obtained from the code repository site or the LIBSVM site.

** To compile the code please add the following CUDA libraries to the bin folder of the project or download the release code from the google code repository (which already contains these as part of the visual studio solution).

     cublas64_30_14.dll

     cudart64_30_14.dll

     cudpp64_30_14.dll

     cufft64_30_14.dll

     cutil64.dll

     glew64.dll

     glut32.dll

Nexus version of Perlin simple VBO example from Doctor Dobb's Journal Part 18

 

For convenience, this code snippet provides a version of the Parallel Nsight code that is pretty much ready to build in Visual Studio.

  1. Expand the zip file, which creates the director VS_DDJ018_VBO.
  2. Copy the common directory from the NVIDIA SDK distribution (shown below) to VS_DDJ018_VBO. This places the required dlls, include files, and packages where the Visual Studio project expects them. 
  3. Double-click on the Visual Studio project file in VS_DDJ018_VBO\VS_DDJ018_VBO\DDJ018_VBO\DDJ018_VBO to start.
  4. Build the project by clicking on Build | Build Project.
  5. Right click on project in the Solution Explorer window and select Nsight User Properties
  6. Change localhost in Connection Name to the remote IP address (e.g. 10.37.130.3) or the hostname of the target machine that is running the Parallel Nsight monitor.
  7. The project is ready to run.

 

Note that there are three #define statements in simpleVBO.cpp that define what OpenGL rendering call is to be used. These are:

    • PRIMITIVE_RESTART: This utilizes the primitive restart as described in part 18 of my Doctor Dobb’s article series.
    • SIMPLE_ONE_BY_ONE: Draws each TRIANGLE_FAN separately.
    • MULTI_DRAW: Utilizes the OpenGL glMultiDrawElements() API call.