'cudafe++' died with status 0xC0000005 (ACCESS_VIOLATION)

hello, i have this problem “‘cudafe++’ died with status 0xC0000005 (ACCESS_VIOLATION)”

windows 11. laptop rtx 3050 6gb.

visual studio 2022.

now i have cuda 12.4.1

(

also i try vs 2019.

i try from cuda 11.8 to latest.

i try latest studio driver and game driver to.

i try windows 10 sdk, windows 11 sdk, 143 and 142 build tools.

i try change patch. also i change and try sm_86,compute_86.

)

this is my testing code

include <cuda_runtime.h>
include <device_launch_parameters.h>
include <stdio.h>

global void testKernel()
{
int tid = threadIdx.x;
printf(“Hello from thread %d\n”, tid);
}

int main()
{
printf(“Launching kernel…\n”);
testKernel<<<1, 8>>>();
cudaDeviceSynchronize();
printf(“Done.\n”);
return 0;
}

second test code

include <stdio.h>

global void hello()
{
printf(“Hello from GPU thread %d!\n”, threadIdx.x);
}

int main()
{
printf(“Launching kernel…\n”);
hello<<<1, 5>>>();
cudaDeviceSynchronize();
printf(“Done!\n”);
return 0;
}

any ideas how to fix this?

Hi, @temur.tskhvedadze

Your code can be built successfully in my ENV.
It is highly possible a ENV issue.
Can you please uninstall all Visual Studio and CUDA related and try again on a clean ENV ?