I’m trying to implement a CG algorithm for band-matrices in cuda and cublas.
The only thing i did with cuda is an element-wise vector vector multiplication (which i need for fast matrix - vector multiplications of the band matrices).
But the most simple thing does"t work like i would expect it to :)
cublasStatus status = cublasInit();
if (status != CUBLAS_STATUS_SUCCESS) {
std::cout <<“ERORR: could not initialize CUBLAS”;
return ;
}
I dont have any idea why the cublas initialization could fail!
the compiler likes my includes, no linker errors or anything suspicous.
I"m using Visual Studio 2005.
Is there perhaps a problem when combining cuda with cublas?
I also implemented a CG Algorithm for standard matrices which worked quite well (after some hours of debugging). So CUDA/CUBLAS should be installed correctly
You need to link the emul version of the library (libcublasem.so), if you are compiling in emulation mode.
From the programming guide (Pag. 34, 4.5.2.7):
All code for an application, including any libraries used,
must be compiled consistently either for device emulation
or for device execution. Linking code compiled for device
emulation with code compiled for device execution causes
the following runtime error to be returned upon initialization:
cudaErrorMixedDeviceExecution.