Hi, I just upgraded from a GTX 260 to a GTX 480 in hopes that I could create larger 3D texture references. In the programming guide (version 3.1 beta) it states in appendix G that devices of compute capability 2.0 can have a 4096x 4096x 4096 3D texture. This is up from 2048 in each direction in the 1.3 devices.
Anyway, I can’t seem to be able to create any larger of a texture. It seems to choke on the allocation of the 3D cudaArray before I can even bind it to the texture. The following code works fine if mx < 2048, but I get an ‘invalid argument’ if mx is any larger.
Is there a different way I am supposed to be doing this? Any help would be appreciated, thanks!
-fna
[codebox]cudaArray *testArray = 0;
char *testPtr;
texture<char, 3, cudaReadModeElementType> testTexture;
void runTest( )
{
cudaError_t e1;
int mx = 1024*3;
int my = 128;
int mz = 128;
int numPixels = mx*my*mz;
cudaMalloc((void **)&testPtr, numPixels * sizeof(char)) ;
cudaMemset(testPtr,0,numPixels * sizeof(char)) ;
e1 = cudaGetLastError();
if(e1 != cudaSuccess)
{
printf("\nError in cudaMalloc: ");
printf(cudaGetErrorString(e1));printf("\n");
return;
}
cudaExtent volExtent = make_cudaExtent(mx, my, mz);
cudaChannelFormatDesc charTex = cudaCreateChannelDesc<char>();
cudaMalloc3DArray(&testArray, &charTex, volExtent);
e1 = cudaGetLastError();
if(e1 != cudaSuccess)
{
printf("\nError in cudaMalloc3DArray: ");
printf(cudaGetErrorString(e1));printf("\n");
return;
}
cudaMemcpy3DParms copyParams = {0};
copyParams.srcPtr = make_cudaPitchedPtr((void*) (testPtr), volExtent.width*sizeof(char), volExtent.width, volExtent.height);
copyParams.dstArray = testArray;
copyParams.extent = volExtent;
copyParams.kind = cudaMemcpyDeviceToDevice;
cudaMemcpy3D(©Params) ;
cudaBindTextureToArray(testTexture, testArray) ;
}[/codebox]
I’m running windows XPx64, CUDA toolkit 3.1beta, driver 257.15 with a GTX 480.