1

I am trying to read mxArray from matlab into my custom made .cu file. I have two sparse matrices to operate on. How do I read them inside cusp sparse matrices say A and B ( or in cuSPARSE matrices), so that I can perform operations and return them back to matlab. One idea that I could come up with is to write mxArrays in .mtx file and then read from it. But again, are there any alternatives?

Further, I am trying understand the various CUSP mechanisms using the examples posted on its website.But every I try to compile and run the examples, I am getting the following error.

terminate called after throwing an instance of
'thrust::system::detail::bad_alloc'
  what():  N6thrust6system6detail9bad_allocE: CUDA driver version is
insufficient for CUDA runtime version
Abort

Here are the stuff that is installed on the machine that I am using.

CUDA   v4.2
Thrust v1.6
Cusp   v0.3

I am using GTX 480 with Linux x86_64 on my machine. Strangely enough, code for device query is also returning this output.

CUDA Device Query...
There are 0 CUDA devices.

Press any key to exit...

I updated my drivers and SDK few days. Not sure whats wrong.

I know, I am asking a lot in one questions but I am facing this problem from quite a while and upgrading and downgrading the drivers doesn't seem to solve.

Cheers

MvG
  • 51,562
  • 13
  • 126
  • 251
Recker
  • 1,815
  • 23
  • 47
  • 1
    You should first fix the possible problems related with the drivers and the SDK and run the 'deviceQuery' example successfully. – pQB Jun 05 '12 at 17:08
  • @pQB Thanks for the reply...I updated the drivers and now examples are running fine... – Recker Jun 06 '12 at 14:33

1 Answers1

2

This error is most revealing, "CUDA driver version is insufficient for CUDA runtime version". You definitely need to update your driver.

I use CUSPARSE/CUSP through Jacket's Sparse Linear Algebra library. It's been good, but I wish there were more sparse features available in CUSPARSE/CUSP. I hear Jacket is going to get CULA Sparse into it soon, so that'll be nice.

  • With Jacket and CULA on mind, do you think, implementing a separate sparse matrix * sparse matrix based on SSMULT routine would make sense? since there would be divergence, and overhead of non linear access. Just wanted to know if I can multiply two sparse matrices from matlab on CUDA,efficiently... – Recker Jun 05 '12 at 19:55
  • Thanks for the reply...I updated the drivers and now examples are running fine. – Recker Jun 06 '12 at 14:34
  • Yes, I believe that Jacket can do SSMULT fast, though I've not benchmarked it myself. (can i get an upvote since i helped, i'm new to this?!) – Nathan Bliss Jun 06 '12 at 23:14