help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave and CUDA


From: Mike Puglia
Subject: Re: Octave and CUDA
Date: Tue, 14 Jan 2014 07:53:29 -0800 (PST)

From: Jordi GutiƩrrez Hermoso <address@hidden>
To: mpender <address@hidden>
Cc: address@hidden
Sent: Tuesday, January 14, 2014 9:52 AM
Subject: Re: Octave and CUDA

On Mon, 2014-01-13 at 21:29 -0800, mpender wrote:
> I had hoped to be able to implement a package or similar CUDA
> implementation for Octave to get broader interest in the Octave
> community. Now I am starting to think my goal may be too ambitious
> for the moment.

Are you using a known free CUDA runtime? I don't know of any other
than gdev. Is it working well enough already?

The lack of a widespread free CUDA runtime is a prerequisite before we
can get any sort of CUDA acceleration into Octave as an OF package or
into Octave itself. What about Clover and OpenCL, is that viable
instead?

- Jordi G. H.

I'll just add my two cents here based on a few months of work I put into this last year...

There is not a free CUDA runtime at the moment and there likely will not be for a long time if you want to use NVIDIA GPUs.  NVIDIA's nvcc compiler is the sticking point.  Unless you can get a free version of that you're out of luck, and I don't see them giving up the keys.

Based on my experience, Daniel Kraft is correct in that it is possible to link CUDA code with an oct file, but the CUDA portion has to be compiled into a static library (using nvcc and a C++ compiler) and linked to Octave using mkoctfile.  Again, this is because nvcc is required to compile any CUDA code if you are using NVIDIA GPUs and at present there is no way for mkoctfile to send the correct compile commands through and handle the CUDA object files (or at least that is how I understand it.)

Regarding the other options for GPU programming (OpenCL, Clover, AMP, etc), there seem to be a lot of non-CUDA GPU languages being developed right now.  Unfortunately none are mature enough to say they work well it seems, and it's hard to justify investing a lot of time in them.  If you use CUDA and NVIDIA GPUs right now, at least there are a lot of free libraries and support that come with them.  (I'm not trying to advertise NVIDIA, it's just the only card I've worked with so far.)

As far as Octave-specific issues go, if you want to develop for GPUs on Windows, you will have to use the MSVC version of Octave.  This is because the Windows version of nvcc only works with the MSVC compiler and will not work with gcc/mingw.  This can create a few problems if trying to use the Octave C++ API with your CUDA code, as not all of the Octave API functions are exposed in MSVC the way they are for gcc/mingw.  Some compiler decorations would need to be added to the Octave C++ code to get everything exposed for linking with MSVC tools.  

If working with Linux, none of these problems exist as NVIDIA's Linux version of nvcc works with gcc.  Debugging on NVIDIA's GPU requires the use of Nsight though (unless you are happy using the command-line debugging tools, which has a few limitations), which has it's own learning curve.  Finally, I've found that the combination of Octave+GPUs is considerably faster on Linux than it is on Windows, if using the same hardware.

Cheers,

MTP 




_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave



reply via email to

[Prev in Thread] Current Thread [Next in Thread]