Buildable code or it didn’t happen :-) Now would be a good time to familiarize yourself with the concept of an MCVE (see: [url]https://stackoverflow.com/help/mcve[/url]).
Does the actual code (with proper error checking!) compile and run outside of Nsight? Are you compiling for the correct target architecture (-arch=sm_52)? What is the exact error message returned by Nsight?
demonstrating that the grid in question is reported as (4,1,1) (which is valid) not (4,0,0) which OP stated in original post of this thread (which is not a valid grid dimension)
I would not use the word “invalid” to describe the initialization. It has well-defined semantics, which were explained in detail by txbob. So the initialization is valid, but not what the programmer intended.