help-octave
[Top][All Lists]
Advanced

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

Re: Octave and CUDA


From: Daniel Kraft
Subject: Re: Octave and CUDA
Date: Mon, 13 Jan 2014 07:27:51 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Hi!

On 2014-01-13 07:18, mpender wrote:
> I also found that it is necessary to spell out the name of the CUDA
> libraries that will be used in the linker:
> mkoctfile gpu_sgemm.cc run_sgemm.o -L/usr/local/cuda/lib64
> -I/usr/local/cuda/include -lcuda -L/usr/local/cuda/lib64/cudart
> -L/usr/local/cuda/lib64/cublas
> 
> Even so, the code refers to functions that apparently have been dropped from
> the library, such as cudaThreadSynchronize() in run_sgemm.cu.  I've gotten
> as far as attempting the example call to gnu_sgemm  at the bottom of page 5
> of the article, but now Octave quits with the error "undefined symbol:
> __cudaUnregisterFatBinary"  and I can't even find a reference to that in the
> code.  
> 
> I'm out of ideas how to resolve this error--I have no idea what the
> FatBinary is all about.  Any ideas how to move forward?

I've never looked at the code example you try to use, but I experimented
with Octave and CUDA some time ago myself for a seminar at university.
You can find my report at [1].

  [1] http://www.domob.eu/research/OctaveGPU.pdf

In the compilation workflow, the critical thing for me was to compile
the CUDA code into a shared library and then linking to it from .oct.
This is a nice trick, which I also tried out once to use OpenMP from
within .oct files (for some reason it didn't work directly from the .oct
file, but I didn't investigate further).

>From the commands you showed it seems as if you compile your CUDA with
-fPIC and -shared, but into an .o only (not a shared library) and then
you include that .o file onto the mkoctfile line.  I'm no expert there,
but my impression is that this will use the linker command of mkoctfile
to link statically to your object file, and thus it fails because you
need the CUDA linker.  This is the reason why I used CUDA to link a
shared library and then mkoctfile to only use it as a library (i. e.,
with -lyourlib).

Maybe that helps.  Good luck!

Yours,
Daniel

-- 
http://www.domob.eu/
--
Done:  Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri


reply via email to

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