# Basic CUDA program not working

**URL:** <https://forums.developer.nvidia.com/t/basic-cuda-program-not-working/122449>\
**Category:** Other Tools\
**Tags:** compile, cuda\
**Created:** [May 8, 2020, 3:58pm UTC](https://forums.developer.nvidia.com/t/basic-cuda-program-not-working/122449 "2020-05-08T15:58:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![saheed.subscriptions](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@saheed.subscriptions](https://forums.developer.nvidia.com/u/saheed.subscriptions)\
**Post date:** [May 8, 2020, 3:58pm UTC](https://forums.developer.nvidia.com/t/basic-cuda-program-not-working/122449/1 "2020-05-08T15:58:06Z")

</div>

OS is CentOS 8  
$ nvidia-smi

Fri May 8 16:38:21 2020  
±----------------------------------------------------------------------------+  
| NVIDIA-SMI 390.132 Driver Version: 390.132 |  
|-------------------------------±---------------------±---------------------+  
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |  
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |  
|===============================+======================+======================|  
| 0 NVS 5400M Off | 00000000:01:00.0 N/A | N/A |  
| N/A 42C P8 N/A / N/A | 0MiB / 964MiB | N/A Default |  
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+  
| Processes: GPU Memory |  
| GPU PID Type Process name Usage |  
|=============================================================================|  
| 0 Not Supported |  
±----------------------------------------------------------------------------+

Here is the code:

```
#include <cstdio>

```

#include “cuda.h”

void CPUFunction()  
{  
printf(“Runs on the CPU.\n”);  
}

**global**  
void GPUFunction()  
{  
printf(“Runs on the GPU.\n”);  
}

int main()  
{  
CPUFunction();

GPUFunction\<\<\<1, 1\>\>\>();

cudaDeviceSynchronize();

return EXIT\_SUCCESS;

}

Output:  
Runs on the CPU.
