I read that NVIDIA ships a BLAS reference installation. I use MATLAB a lot, and MATLAB uses BLAS, so can I somehow use the NVIDIA-provided BLAS and check the performance?

Platform is Linux, XP or Vista.


No, you can’t have MATLAB use CUBLAS instead of the BLAS library MATLAB is built against if this is what you mean.

An application must be explicitly coded on top of CUBLAS in order to use it.

Also, note that only a subset of the CUBLAS core functions is implemented in the current version of CUBLAS.

But you could write a matlab plugin that makes calls into CUBLAS…


Matlab is not built against any specific BLAS library, but you can choose which BLAS (e.g. MKL or ATLAS) to use by setting an environment variable.

If CUBLAS implements a subset of BLAS I guess it’s possible to code an own BLAS wrapper that matlab uses. It could route the BLAS functions that CUBLAS implements to CUBLAS and the rest to some other implementation.


Yes, you could write a host BLAS that routes the appropriate BLAS calls to the GPU.

The size of the arguments is also going to be important, if the matrices are too small you are better off doing the computation on the host.

Most important, the current BLAS implementation is single precision only.

Which one is single precision only CUBLAS or the BLAS lib that comes with MATLAB?


The G80 is a single precision GPU.

Another thing to note is that you would want to make it possible to perform multiple cascaded BLAS operations on the data while it stays on the GPU, rather than to read the results back after every CUBLAS operation. Otherwise you will reduce the benefit of the GPU due to bandwidth bottlenecks.


It’s not regarding BLAS, but about MATLAB integration with CUDA.

I need to implement several functions on GPU with CUDA.
I successfully compile DLL with function from .cu files. cu files contain only stub code, no actual gpu kernels are implemented yet.
When I execute function from MATLAB it works normally, but after some time or when I close MATLAB, MATLAB crashes.

I repeated reproduced the issue in the debugger and it seems that crash (Unhandled exception at 0x206c38d1 in MATLAB.exe: 0xC0000005: Access violation reading location 0x00000000.) occurs in function cudart.dll:cudaGetSymbolSize.

I need to be able to run my MATLAB DLL in emulation mode so I chose runtime API.

Do you have any suggestions?

P.S.: I’m able to successfully run CUDA applications in emulation mode from EXE files.

it is a known bug under Windows. The fix will be available in the next release.
In the meantime, could you run MATLAB under Linux?

Thank you for prompt reply.
Unfortunately I need to run Windows version of MATLAB. I hope that next release will be out soon.


I just wanted to update this thread by pointing out we, at AccelerEyes, just released Jacket, which is a full GPU Engine for MATLAB. With Jacket, you can do everything that is discussed in this thread and avoid the memory transfer bottlenecks pointed out by Mark Harris.

Check it out at:

We look forward to hearing your feedback on Jacket and hope to be able to adapt it to best suit your MATLAB GPU computing needs.


John Melonakos