CPU and GPU synchronization issue in Google Colab

not able to synchronize CPU and GPU using cudaDeviceSynchronize(); in google colab.
Hence not able to fetch the kernels.

Kindly help.
Sharing the code here:
%%writefile helloworld.cu

include <stdio.h>

global void hello() {
printf(“Hello World!\n”);

int main() {
hello<<<1, 1>>>();
return 0;

There is nothing wrong with the code you have shown. Make sure your colab instance actually has a GPU assigned (an “ordinary” colab instance does not) and make sure you are compiling for the architecture of your GPU.

Finally, use proper CUDA error checking.