Page 1 of 1

Trouble with Matlab link Interface

PostPosted: Sat Aug 25, 2012 2:33 am
by prisma

now that CULA R15 dense is available, i tested it with my various configurations:
OS:Ubuntu Linux
2010b R14 ok
2010b R15:
Code: Select all
libmwlapack: load error: /usr/local/cula/lib64/ undefined symbol: dlamc1_
Caught "std::exception" Exception message is:
/usr/local/cula/lib64/ undefined symbol: dlamc1_

2012a R14 (see viewtopic.php?f=15&t=1010)
2012a R15
Code: Select all
cula error: culaInitialize failed (CUDA runtime or driver is not supported)
cula info:  forwarding all calls to CPU
cula info:  parsing crossover list '/usr/local/cula/crossover.list'
cula info:  setting crossover for dgemm to '22500'
cula info:  setting crossover for dsyrk to '2500'
cula info:  setting crossover for zgetrf to '10000'
cula info:  dgemm (N, N, 5000, 5000, 5000, 1.000000, 0x7f5894143020, 5000, 0x7f5888286020, 5000, 0.000000, 0x7f587c3c9020, 5000)
cula info:  issuing to CPU (cula not available)
cula info:  CPU library is /usr/local/cula/lib64/
cula info:  done

This seems to be the same Problem again that MATLAB loads some cuda runtime ahead. I still didn't find anything to do preventing this. ARE YOU NOT TESTING AGAINST MATLAB?
I must say for something advertised i'm quite surprised that the MATLAB link interface is more or less unusable (i'm stuck to the R2010b R14 combination which ingnores crossover_list). I think i will have to look at JACKET although it's expensive and requires changing of my code.


Re: Trouble with Matlab link Interface

PostPosted: Tue Aug 28, 2012 12:17 pm
by john
Dear Sebastian, I can assure you that the all-caps questions are not necessary - we are interested in making this work. CULA has been tested repeatedly against Matlab on a number of configurations.

Matlab presents two distinct problems for us.

1) The Matlab LAPACK is something of a moving target for us because it's changed periodically. Any given release of CULA might only be compatible with a couple versions of Matlab.

2) Their GPU environment in the GPU toolbox is very invasive. It loads whether you use it or not, and that prevents other GPU products from being loaded correctly (especially if the CUDA version isn't a precise match). Unfortunately Mathworks has decided not to update their CUDA version for quite some time and still ships CUDA 4.0. Our philosophy is to always remain current with the latest production release of CUDA, as this is important to continue supporting new hardware devices. To this end, our tests target systems withoutthe Matlab GPU toolkit. I suspect that the presence of the GPU toolkit is causing the majority of your problems, and so I would try on the Mathworks or NVIDIA forums for advice on how to load a different CUDA version. You could also try disabling that toolkit while you try to get CULA up and running.

(A thought: LD_PRELOAD might be able to handle the Matlab CUDA situation, but I haven't tried.)

I would like to note in closing that Matlab is not officially on our supported list. We are fundamentally a programmer-oriented C, C++, Fortran, and PGI CUDA-Fortran library. If Matlab becomes an official platform of ours, it will become noted in the Programmer's Guide and the package will contain examples (etc). The Link interface happens to shine when used with Matlab and so is our go-to for demonstration.

Re: Trouble with Matlab link Interface

PostPosted: Mon Sep 03, 2012 5:19 am
by prisma

thanks for the answer and the hints. I managed to make matlab 2012a and cula R15 work by deleting the cuda libs from the matlab/bin/glnxa64 dir:
This seems very drastic but it works.

But now something new appears, what i have not seen before:
Code: Select all
cula info:  zgetri (11532, 0x7f7a8b853020, 11532, 0x7f7c08513440)
cula info:  issuing to CPU (work query) <---
cula info:  work query returned 738048
cula info:  done
cula info:  zgetri (11532, 0x7f7a8b853020, 11532, 0x7f7c08513440)
cula info:  issuing to GPU (over threshold)
cula info:  done

What does this work query mean and why is it first tried on CPU and then on GPU?

Re: Trouble with Matlab link Interface

PostPosted: Mon Sep 03, 2012 4:34 pm
by kyle
The work queries are tests performed by the host version of LAPACK to see how much extra memory is required by that call. As CULA has no notion of workspaces, these calls are never run on the GPU.