invalid argument from cudaMallocArray

Hi, I am working on Tesla C2050 on redhat linux system. I allocate two cudaArray on devices as below

cudaChannelFormatDesc channelD=cudaCreateChannelDesc(32, 0, 0, 0,
cudaArray *ap_cuArray, *fd_cuArray;
err=cudaMallocArray(&fd_cuArray, &channelD, 64);
printf("%s ! ine: %d \n", cudaGetErrorString(err), LINE);

err=cudaMallocArray(&ap_cuArray, &channelD, 16);
printf("%s ! line: %d \n", cudaGetErrorString(err), LINE);

very simple code. first malloc is successful, but the second malloc gets “invalid argument” error.
i try different number of bytes, all happen with the same problems. This makes me can not have
several textures. a few days ago, the codes work fine. i do not know what i have did, these codes
can not work now. my provious code
cudaEvent_t start, stop; err=cudaEventCreate(&start); err=cudaEventCreate(&stop); cudaEventRecord(start,0);
also get error “invalid configuration argument” now.

Is there something happened with my CUDA environment? The machine is a server, it is difficult for me to reinstall everything.
Thank you very much if you have any suggestions.

Hi wabwan, I have a very similar problem (I think). I’m using a Tesla C1060 on Windows 7, 64 bit. I’ve not found the cause myself yet, but I’m looking into it. The problem doesn’t seem to occur on colleagues’ machines which are using various Fermi class cards.

My code:

cudaArray* create_table(float * table)



    cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc<float4>();

    cudaArray* cuArray;

cudaError_t c_err =  cudaMallocArray(&cuArray, &channelDesc, 65536, 1);

    printf("%s ! Line: %d \n", cudaGetErrorString(c_err), __LINE__);

unsigned char * table_origin  = (unsigned char*) table;

    unsigned int bytes = 256 * 256* 4 * sizeof(float);

c_err = cudaMemcpyToArray(cuArray, 0, 0, table_origin,  bytes, cudaMemcpyHostToDevice);

    printf("%s ! Line: %d \n", cudaGetErrorString(c_err), __LINE__);

return cuArray;


My output:

no error ! Line: 215

invalid argument ! Line: 222