On an internal build, I cannot replicate your bug (so if it was there, it has been fixed).
[fatica@dhcp ~]$ ./a.out
malloc Array:(128,128)
Succes
fatica@dhcp ~]$ ./a.out
malloc Array:(12800,128)
Succes
fatica@dhcp ~]$ ./a.out
malloc Array:(22800,128)
Succes
[fatica@dhcp- ~]$ ./a.out
malloc Array:(22800,22800)
CUDA error: out of memory, line 15
why this ? I guess I should be allowed to have the second dimension equal to 1 no ?
also, I found out why I was having such limitation, the reason was I had another openGl process running in the same time on the device which was taking memory.
Now my other question, what is the limitation of the cudaymallocArray, is it the 768 mb of the device minus some runtime memory usage ?
if I create two textures :
texture<float4, 2, cudaReadModeElementType> t1;
texture<float, 2, cudaReadModeElementType> t2;
I allocate/bind them :
malloc t1:(248,31)
Succes
malloc t2:(30752,4)
Succes
all the elements of t2 are presumably such that texfetch(t2, i, 0…3) = i;
however, when I do texfetch(t2, 0, 0…3)
I get 16384.0 (where I should get 0)
and texfetch(t2, 1, 0…3)
I get 16385.0 (where I should get 1)
then if I do texfetch(t2, 16384, 0…3) I get something random. same for other value beyond that.
So why is that ? is my two textures too big or something ? I really don’t understand…
and of course if I use smaller cudaArray like :
malloc textInput:(168,21)
malloc textFilter:(14112,4)
In the current release, if the second dimension is equal to 1, the first dimension has to be smaller than 8192. There is a 8K limit for 1D Texture arrays and CUDA views a 2D array Nx1 as a 1D array of length N.
Yes, I have the same problem… As soon as I attempt to allocate an array larger than 32768 I get the invalid argument error. Even if I increase my second dimension to an arbitrary number greater than one, I cannot go above this limit.
And, if you do that, can you use up to the maximum device memory (theoretically)? And, if you can use all that memory, I wonder what kind of overhead that implies. Aka, I wonder if it’s worth it in the end…