Too large input size

Questions and Answers : GPU applications : Too large input size
Message board moderation

To post messages, you must log in.

AuthorMessage
BarryB

Send message
Joined: 27 Dec 11
Posts: 2
Credit: 0
RAC: 0
Message 1181007 - Posted: 27 Dec 2011, 21:14:05 UTC

I’m working on a CUDA program, but I have some trouble when I partition the input data.
The situation is as follows: The program should do some operations on elements of an array and place the results in another. The input element type is a self-defined struct (12 bytes) and the result array contains floats. The program works fine when the input size is small enough to fit in GPU memory. Having an input which is too large for GPU memory is a problem. Currently, I execute the kernel multiple times when the input doesn’t fit (once for every part of the input). The code I have for this part is as follows where ‘index’ is the index of the first element of the input of current part:

cudaMemcpy(d_input, &input[index], partsize * sizeof(12byte_struct), cudaMemcpyHostToDevice);

Kernel<<<nrofblocks, blocksize>>>(partsize, d_input, d_output);

cudaMemcpy(output + index, d_output, partize * sizeof(float), cudaMemcpyDeviceToHost);


The weird thing is that this works for small input (which would fit completely in GPU memory) when I ‘split’ it in multiple parts, but not for large input. Also, it does not seem to matter for a large input what operations are performed in the kernel; the output is the same. So, I think it has something to do with the memory. I don’t get any memory allocation or copy errors.

Does anyone has an idea how I can solve this problem? Would freeing and reallocating d_input or d_output do any good?
ID: 1181007 · Report as offensive
OzzFan Crowdfunding Project Donor*Special Project $75 donorSpecial Project $250 donor
Volunteer tester
Avatar

Send message
Joined: 9 Apr 02
Posts: 15691
Credit: 84,761,841
RAC: 28
United States
Message 1181013 - Posted: 27 Dec 2011, 22:15:04 UTC - in response to Message 1181007.  

Hi Barry,

I'm afraid you're looking for assistance in the wrong place. This forum supports BOINC and SETI@Home users with their issues using the BOINC framework and SETI@Home software.

It would seem to me that you are looking for coding advice on how to write your own CUDA application, which is out of the scope of this forum. There is a forum of programmers who write CUDA code for SETI@Home located at http://lunatics.kwsn.net who may be able to help you, however, you can only post to their forum upon invite only. I believe SETI@Home user Jason_Gee may be able to help you with an invite.

OzzFan
ID: 1181013 · Report as offensive
BarryB

Send message
Joined: 27 Dec 11
Posts: 2
Credit: 0
RAC: 0
Message 1181020 - Posted: 27 Dec 2011, 22:38:39 UTC - in response to Message 1181013.  

Oke, thanks for the info.
ID: 1181020 · Report as offensive

Questions and Answers : GPU applications : Too large input size


 
©2024 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.