bugGNU Octave - Bugs: bug #43826, Deadlock with CUBLAS and dlopen...

 
 

bug #43826: Deadlock with CUBLAS and dlopen inside a accelerated BLAS replacement.

Submitted by:  None
Submitted on:  Mon 15 Dec 2014 04:09:38 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: InvalidAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 3.8.1
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 22 Dec 2014 09:41:54 PM UTC, comment #4:

PMFJI

@OP: did you by any chance use this post?
http://devblogs.nvidia.com/parallelforall/drop-in-acceleration-gnu-octave/

Philip Nienhuis <philipnienhuis>
Project Member
Mon 15 Dec 2014 05:42:49 PM UTC, comment #3:

I can use the same argument: Octave works fine with any other BLAS, so cuBLAS must be the problem.

I'm going to close this bug as invalid for now. If you can come up with a better diagnostic that indicates that Octave is doing something wrong, we can reopen this bug.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Mon 15 Dec 2014 05:36:06 PM UTC, comment #2:

The problem is that with many other software using BLAS this works and the backtrace only involves stuff that is Octave related. Thats why I conclude that it may be an Octave problem.

Anonymous
Mon 15 Dec 2014 04:25:42 PM UTC, comment #1:

I don't understand. What's the Octave bug? This seems like a problem with cuBLAS or your usage of cuBLAS. What do you think Octave is doing wrong?

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Mon 15 Dec 2014 04:09:38 PM UTC, original submission:

I created a small wrapper experiment around CUBLAS which I want to use with Octave. Therefore I picked up the NETLIB BLAS implementation and replaced the dgemm.f file ( Which implements the double precision matrix-matrix multiply) by the following C code:

The I wrote the real wrapper as a second shared object in order to be able to replace it easily without relinking or LD_LIBRARY_PATH stuff. This looks like

And is compiled using "gcc -shared -O2 -o libblastest_dgemm.so -lcublas -lcudart". I integrated my the whole thing using update-alternatives into my Ubuntu system. If I then run programs that use the dgemm call everything works fine and faster than on the CPU for large data sets. Only one application does not work as well and run into a deadlock. If I run GNU Octave it hangs after displaying its copyright information. Interrupting octave with GDB I got the following backtrace:

I think the problem may the fact that the `libcuda.so` from the driver is as well loaded via dlopen from the libcudart library. But I do not know how to fix this. Any suggestions how I can fix this problem while keeping my dlopen approach?

The whole source of the BLAS library is available at: http://www-e.uni-magdeburg.de/makoehle/blas_test.tar.gz (Also attached) The `make install` target also includes the setup of update-alternatives on Debian-like systems.

Use hard and software:

- Ubuntu 14.04.1 (amd64) with gcc 4.8.2 and glibc 2.19
- CUDA 6.5, Driver 340.29
- GNU Octave 3.8.1
- GeForce GTX 580

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #32673:  blas_test.tar.gz added by None (130KiB - application/x-gzip - Blas Wrapper mentioned in the Bug)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jordigh (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 15 Dec 2014 05:42:49 PM UTCjordighStatusNeed Info=>Invalid
      Open/ClosedOpen=>Closed
    Mon 15 Dec 2014 04:27:21 PM UTCjordighItem GroupSegfault, Bus Error, etc.=>Other
    Mon 15 Dec 2014 04:25:42 PM UTCjordighStatusNone=>Need Info
    Mon 15 Dec 2014 04:09:38 PM UTCNoneAttached File-=>Added blas_test.tar.gz, #32673

    Back to the top


    Powered by Savane 3.1-cleanup1