# CUDA bindings?

**URL:** <https://www.ruby-forum.com/t/cuda-bindings/148089>\
**Category:** Ruby\
**Created:** [September 9, 2008, 6:15am UTC](https://www.ruby-forum.com/t/cuda-bindings/148089 "2008-09-09T06:15:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzakiya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ec8ea/32.png) [@jzakiya](https://www.ruby-forum.com/u/jzakiya)\
**Post date:** [September 9, 2008, 6:15am UTC](https://www.ruby-forum.com/t/cuda-bindings/148089/1 "2008-09-09T06:15:47Z")

</div>

I was wondering if anybody has (is thinking of) creating CUDA  
bindings. I searched this forum archives, and [rubyforge.org](http://rubyforge.org), but  
couldn’t find any references to CUDA.

Wikipedia showed an example with python.

> **[CUDA](https://en.wikipedia.org/wiki/CUDA)**
>
> CUDA (or Compute Unified Device Architecture) is a proprietary and closed source parallel computing platform and application programming interface (API) that allows software to use certain types of graphics processing units (GPUs) for general purpose processing, an approach called general-purpose computing on GPUs (GPGPU). CUDA is a software layer that gives direct access to the GPU's virtual instruction set and parallel computational elements, for the execution of compute kernels.
> CUDA is desig...

CUDA (Compute Unified Device Architecture), is a compiler and set of  
development tools that enable programmers to use a variation of C to  
code algorithms for execution on the graphics processing unit (GPU).  
CUDA has been developed by NVIDIA and to use this architecture  
requires an Nvidia GPU and drivers. The latest drivers all contain the  
necessary CUDA components. CUDA works with all NVIDIA GPUs from the  
G8X series onwards, including GeForce, Quadro and the Tesla line.  
NVIDIA states that programs developed for the GeForce 8 series will  
also work without modification on all future Nvidia video cards, due  
to binary compatibility. CUDA gives developers access to the native  
instruction set and memory of the massively parallel computational  
elements in CUDA GPUs. Using CUDA, the latest NVIDIA GPUs effectively  
become open architectures like CPUs (Central Processing Units). Unlike  
CPUs however, GPUs have a parallel “many-core” architecture, each core  
capable of running thousands of threads simultaneously - if an  
application is suited to this kind of an architecture, the GPU can  
offer large performance benefits. CUDA provides both deterministic low  
level API and a higher level API.

---

<div class="post-metadata">

**Author:** ![jzakiya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ec8ea/32.png) [@jzakiya](https://www.ruby-forum.com/u/jzakiya)\
**Post date:** [September 9, 2008, 6:30pm UTC](https://www.ruby-forum.com/t/cuda-bindings/148089/2 "2008-09-09T18:30:00Z")

</div>

On Tuesday 09 September 2008 05:43:46 jzakiya wrote:

> I was wondering if anybody has (is thinking of) creating CUDA  
> bindings. I searched this forum archives, and [rubyforge.org](http://rubyforge.org), but  
> couldn’t find any references to CUDA.  
> I was thinking about that few months back, but didn’t really get to it  
> due to  
> lack of time. Also there’s the problem of target audience - the number  
> of  
> people that would be interested in it can be counted on the fingers of  
> one  
> hand of blind butcher. (And those people can as well go the Python  
> route)

Jan

---

<div class="post-metadata">

**Author:** ![jzakiya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ec8ea/32.png) [@jzakiya](https://www.ruby-forum.com/u/jzakiya)\
**Post date:** [September 13, 2008, 2:19am UTC](https://www.ruby-forum.com/t/cuda-bindings/148089/3 "2008-09-13T02:19:22Z")

</div>

On Wed, 10 Sep 2008, Jan D. wrote:

> On Tuesday 09 September 2008 05:43:46 jzakiya wrote:
> 
> > I was wondering if anybody has (is thinking of) creating CUDA  
> > bindings. I searched this forum archives, and [rubyforge.org](http://rubyforge.org), but  
> > couldn’t find any references to CUDA.  
> > I was thinking about that few months back, but didn’t really get to it due to  
> > lack of time. Also there’s the problem of target audience - the number of  
> > people that would be interested in it can be counted on the fingers of one  
> > hand of blind butcher. (And those people can as well go the Python route)

Actually, I am interested and I’ll be a number of the folks on the  
Beowulf  
list would be interested.

– Matt  
It’s not what I know that counts.  
It’s what I can remember in time to use.

---

<div class="post-metadata">

**Author:** ![jzakiya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ec8ea/32.png) [@jzakiya](https://www.ruby-forum.com/u/jzakiya)\
**Post date:** [May 13, 2009, 4:17am UTC](https://www.ruby-forum.com/t/cuda-bindings/148089/4 "2009-05-13T04:17:41Z")

</div>

I’m interested too =)

---

<div class="post-metadata">

**Author:** ![jzakiya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ec8ea/32.png) [@jzakiya](https://www.ruby-forum.com/u/jzakiya)\
**Post date:** [May 13, 2009, 5:01am UTC](https://www.ruby-forum.com/t/cuda-bindings/148089/5 "2009-05-13T05:01:34Z")

</div>

On Tue, May 12, 2009 at 8:17 PM, Sergio F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m interested too =)

I know the Rubinius people were interested in using GPU-type features or  
maybe CUDA. Evan P., the Rubinius head honcho, was even talking  
about  
using GPU features to accelerate things like method dispatch. Pretty  
nuts.

---

<div class="post-metadata">

**Author:** ![jzakiya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ec8ea/32.png) [@jzakiya](https://www.ruby-forum.com/u/jzakiya)\
**Post date:** [August 31, 2009, 2:30am UTC](https://www.ruby-forum.com/t/cuda-bindings/148089/6 "2009-08-31T02:30:05Z")

</div>

Not quite CUDA, but I’ve written a very simple OpenCL wrapper library  
for Ruby called Barracuda.

> **[Barracuda: An OpenCL Library for Ruby](https://gnuu.org/2009/08/30/barracuda-an-opencl-library-for-ruby/)**
>
> Barracuda is my latest experiment. I wanted to toy around with the new features of Snow Leopard, and as far as I’ve seen, there are no CUDA or OpenCL wrapper libraries out there for Ruby.
> OpenCL, if you don’t know, is an “open” version of CUDA, which...

It currently only works on OSX 10.6 (Snow Leopard), but if you have the  
OpenCL libs installed on your machine and are willing to hack the  
Makefiles for a few minutes, you could probably get it to compile for  
other platforms.

---

<div class="post-metadata">

**Author:** ![jzakiya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ec8ea/32.png) [@jzakiya](https://www.ruby-forum.com/u/jzakiya)\
**Post date:** [October 4, 2009, 10:07pm UTC](https://www.ruby-forum.com/t/cuda-bindings/148089/7 "2009-10-04T22:07:43Z")

</div>

nice one Loren

Anybody have found where to use it ?

---

<div class="post-metadata">

**Author:** ![jzakiya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3ec8ea/32.png) [@jzakiya](https://www.ruby-forum.com/u/jzakiya)\
**Post date:** [June 28, 2010, 9:00pm UTC](https://www.ruby-forum.com/t/cuda-bindings/148089/8 "2010-06-28T21:00:12Z")

</div>

I think this posting falls into the category of being a replay to a  
related question: “Attention: posting any kind of advertisement for  
commercial products or services, unless in reply to a related question,  
is prohibited.”

I have posted the KappaCUDA rubygem (under the MIT License). The Kappa  
Library is a commercial library that uses the NVIDIA CUDA driver API to  
give an object-oriented scheduler based interface to CUDA, C/C++ OpenMP,  
Perl, and Python. The Kappa scheduler allows mixing these different  
components together in combined tasks and libraries. The Kappa  
scheduler ends up giving better performance on the current NVIDIA  
hardware than directly using the NVIDIA APIs–even with pure C++ code.

The Perl and Python keywords are extensions to Kappa. The Perl and  
Python keywords’ source code are MIT License–it should be easy for  
anyone with knowledge of embedded Ruby to use these examples to create a  
Ruby keyword so that you can not only have a task being executed by Ruby  
but that it can combine CUDA, C/C++ OpenMP, Perl, Python, and Ruby.
