GPU application does not execute

I started to learn CUDA very recently and I am facing a problem in the very first stage. I spent almost a day finding out the root cause but was not successful. Following is my code snippet:

#include <stdio.h>

__global__ void helloWorldGPU(void){
	printf("Hello to GPU");

int main(void){
	printf("Hello to CPU");
	helloWorldGPU <<<1, 5>>>();
	return 0;

There is no debug error and the application runs as well. However, nothing is printed on the console by GPU.

  • No remote connection (GEFORCE 940MX)
  • Ubuntu 18.04
  • Java 8
  • Gcc 7.5
  • CUDA 10.2
  • NVIDIA driver 440

Do I miss any configurations or path inclusions?