'cuda compute compatibility issue

Recently I started to learn CUDA, and here is my first cuda program. I compiled it with nvcc hello.cu -o hello and ran it with ./hello, but nothing is printed.

Is it because I'm using cuda 10 which is not supported by GTX 1050?

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
#include <stdio.h>
#include <cuda_runtime.h>

__global__ void test(){
    printf("Hi Cuda\n");
}

int main( int argc, char** argv )
{
    test<<<1,1>>>();
    cudaDeviceSynchronize();
    return 0;
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source