CUBLAS crash in VS 2005 Express cublas init return fail

I’m working on a large project that works just fine in Linux. I’ve recently been porting over the application to windows, and found that cublas crashes on initialization. Since there’s a lot going on with the video card, I decided to create a small example to demonstrate the crash.

#include <stdio.h>

#include <cutil.h>

#include <cublas.h>

int runTest();

int main() {

     int retval = runTest();

    return 0;


int runTest() {

      cublasStatus status;

     status = cublasInit();

    return status;


The code compiles just fine, then, on execution, I get the following errors in visual studio.

Microsoft C++ exception: cudaError_enum at memory location 0x0012fc84…

Microsoft C++ exception: cudaError at memory location 0x0012fcd4…

I’ve used the build rule that is on these forums, and I’m not compiling in emulation mode. I have also ensured that I’m using the cublas library and not the cublasemu library

Any suggestions on what to do about this would be greatly appreciated.



I have the same Problem with VS2008

The CUBLAS samples from the SDK all report “PASSED”.

My .cu compiles and runs fine unless I include and link cublas in which case it crashes with an execption similar to the above on cublasInit(). I have run out of ideas what the reason could be and would apprechiate any help.

I have the same problem using CUDA 3.1 on VS2005. The program crash when cublas is initializating. I don’t know what is the promblem. But my cublas sample from the SDK crash too.