SDK Mersenne Twister: unspecified launch failure

There was a previous post about this, but the poster stated he had solved the problem with no details and the thread died.

I am using the SDK Mersenne Twister with many calls. It works many times until it returns:

Cuda error in file '../MersenneTwister/MersenneTwister_kernel.cu' in line 55 : unspecified launch failure.

The function containing the line of code identified in the error message is below with line 55 being the “CUDA_SAFE_CALL( cudaMemcpyToSymbol(ds_MT, MT, sizeof(h_MT)) );”. Previously in MersenneTwister_kernel.cu the variables are set. I include their definitions before the function.

__device__ static mt_struct_stripped ds_MT[MT_RNG_COUNT];

static mt_struct_stripped h_MT[MT_RNG_COUNT];

//Initialize/seed twister for current GPU context

void seedMTGPU(unsigned int seed){

	int i;

	//Need to be thread-safe

	mt_struct_stripped *MT = (mt_struct_stripped *)malloc(MT_RNG_COUNT * sizeof(mt_struct_stripped));

	for(i = 0; i < MT_RNG_COUNT; i++){

		MT[i]	  = h_MT[i];

		MT[i].seed = seed+i;

	}

	CUDA_SAFE_CALL( cudaMemcpyToSymbol(ds_MT, MT, sizeof(h_MT)) );

	free(MT);

}

My only change to the SDK code is the “MT[i].seed = seed+i;” where \i added the “+i” to have distinct seeds and therefore distinct random number generators.

I can’t seem to fix this or even identify the cause. Help, please?

If you did not change the MT code, then check your other code. The problem probably is not in the MT code.

If you did not change the MT code, then check your other code. The problem probably is not in the MT code.

I wrote a piece of code that just called the MT over and over again to check that it wasn’t my code. It causes the same failure.

I wrote a piece of code that just called the MT over and over again to check that it wasn’t my code. It causes the same failure.

I wrote a piece of code that just called the MT over and over again to check that it wasn’t my code. It causes the same failure.

The MT from CUDA SDK v3.2RC works fine. Have you tried to revise the MT from CUDA SDK to call MT over and over again and see if it works?

You may try to use CURAND in v3.2RC, or the better MT code from the website of the original Japanese researcher (their code is for Linux, but with a little effort we can make it work under Windows). I have tried both of them. Both are OK (and better supposedly).

The MT from CUDA SDK v3.2RC works fine. Have you tried to revise the MT from CUDA SDK to call MT over and over again and see if it works?

You may try to use CURAND in v3.2RC, or the better MT code from the website of the original Japanese researcher (their code is for Linux, but with a little effort we can make it work under Windows). I have tried both of them. Both are OK (and better supposedly).

The MT from CUDA SDK v3.2RC works fine. Have you tried to revise the MT from CUDA SDK to call MT over and over again and see if it works?

You may try to use CURAND in v3.2RC, or the better MT code from the website of the original Japanese researcher (their code is for Linux, but with a little effort we can make it work under Windows). I have tried both of them. Both are OK (and better supposedly).

Thanks for your help. You were right; the error was elsewhere in my code. Strangely, an error completely unrelated to the MT was causing a failure which then returned an error message regarding the MT every single time.

Thanks for your help. You were right; the error was elsewhere in my code. Strangely, an error completely unrelated to the MT was causing a failure which then returned an error message regarding the MT every single time.