I just started programming in Cuda. Right now I’m trying to recompile a free software from the internet. It compiles fine, but when I run it, I immediately get an error. The error is caused by a call to cudaMallocHost, which is trying to allocate 28 MB. I get an cuda unknown error. After searching online I tried to check if an error was set just before the call, and it was not. I then tried to lower the amount of memory, and I managed to make it work only when I allocated few thousand of bytes. The PC i’m working on is an i7 with 6 GB of RAM, so it should not be out of memory. Is there anything I can try to make it work?
PS: I tried using CudaAllocHost with the same results…
Can you tell us the specific information of error ?
I don’t have any specific information on the error, since the cudaSafeCall returns unknown error, and cudaGetErrorString too.
Post your code that is doing the allocating
I’m trying to compile the CUJ2K program, you can find it here: http://cuj2k.sourceforge.net/. The problem shows up in the bmp-read.cu file, around line 305-310 (I changed the code a bit so I’m not sure about the exact line number). If you want to try and compile it, you should change a bit the code. In particular in file device.cu, line 167, you should change the line that checks the cuda version to
if( major >1 || (major == 1 && minor >= 1))
otherwise if you have a rather new video card (i.e. cuda 2.0 or later) it won’t run complaining your card does not support the cuda version.
PS: actually also the code right above that line in device.cu should be changed, but it won’t be a problem if you have only one nvidia video card in your system