Texture Object Management (CUDA 5) unknown error in cudaCreateTextureObject


I’m testing new CUDA 5.0 version and i’m implementing a Texture Object manager sample using the new functions.
Well, first I define the objects

cudaTextureObject_t texObject;
struct cudaResourceDesc resDesc;
struct cudaTextureDesc ptexDesc;

Second, I create a cudaArray

cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc(32, 0, 0, 0, cudaChannelFormatKindFloat);
cudaArray * cuArray;
float h_data[1000];
for(int i=0;i<1000;i++){

cudaMallocArray(&cuArray, &channelDesc, width, height);

cudaMemcpyToArray(cuArray, 0, 0, (void *)h_data, sizeof(float)*w*h,cudaMemcpyHostToDevice);

Third, I initialize the variables

memset(&resDesc, 0, sizeof(resDesc));
resDesc.res.array.array = cuArray;
resDesc.resType = cudaResourceTypeArray;

memset(&ptexDesc, 0, sizeof (ptexDesc));
ptexDesc.addressMode[0] = cudaAddressModeWrap;
ptexDesc.addressMode[1] = cudaAddressModeWrap;
ptexDesc.filterMode = cudaFilterModeLinear;
ptexDesc.readMode = cudaReadModeElementType;
ptexDesc.normalizedCoords = 1;

Finally, I try to create the cudaTextureObject_t object

…and it fails.

Thanks for your time


From 5.22.1 in the v5 Toolkit reference:
“The texture object API is only supported on devices of compute capability 3.0 or higher”
Hmm, time to switch our 580’s for Titans?