cudann mnistCUDNN make fails with /usr/local/cuda/include/cuda_runtime_api.h:2232:24: error: expected ‘)’ before ‘*’ token

After installing cudann 7.4 for Cuda10, I try running the test and it fails on the make clean && make command with this output:

rm -rf o
rm -rf mnistCUDNN
/usr/local/cuda/bin/nvcc -ccbin g++ -I/usr/local/cuda/include -IFreeImage/include -m64 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_53,code=compute_53 -o fp16_dev.o -c fp16_dev.cu
g++ -I/usr/local/cuda/include -IFreeImage/include -o fp16_emu.o -c fp16_emu.cpp
g++ -I/usr/local/cuda/include -IFreeImage/include -o mnistCUDNN.o -c mnistCUDNN.cpp
In file included from /usr/local/cuda/include/channel_descriptor.h:61,
from /usr/local/cuda/include/cuda_runtime.h:95,
from /usr/include/cudnn.h:64,
from mnistCUDNN.cpp:30:
/usr/local/cuda/include/cuda_runtime_api.h:2232:24: error: expected ‘)’ before ‘
’ token
typedef void (CUDART_CB *cudaStreamCallback_t)(cudaStream_t stream, cudaError_t status, void *userData);
~ ^~
)
/usr/local/cuda/include/cuda_runtime_api.h:2300:9: error: ‘cudaStreamCallback_t’ has not been declared
cudaStreamCallback_t callback, void *userData, unsigned int flags);
^~~~~~~~~~~~~~~~~~~~
/usr/local/cuda/include/cuda_runtime_api.h:2484:81: error: ‘cudaGraph_t’ has not been declared
t__ cudaError_t CUDARTAPI cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t *pGraph);
^~~~~~~~~~~
I have attached the full error report.

My system
OS: Ubuntu 18.10
GPU: GEForce RTX 2080ti
NVIDIA-DRIVER: 410.73
CUDA: 10.0
cuDNN: 7.4

anyone have any ideas why I’m getting this?
cudann_mnistCUDNN_error.txt (86.6 KB)

Did you set all the cuda environmental variables?

I believe so. Anyway, I ended up just downgrading to ubuntu 18.04 and had no trouble setting everything up.

run sudo anyeditorwhichyoulike /usr/local/cuda/include/cuda_runtime_api.h
before this line

typedef void (CUDART_CB *cudaStreamCallback_t)(cudaStream_t stream, cudaError_t status, void *userData);

add this code

[b]

#ifdef _WIN32
#define CUDART_CB __stdcall
#else
#define CUDART_CB
#endif

[/b]

And the solution for the third error (cudaGraph_t not been declared) is here:
https://devtalk.nvidia.com/default/topic/1045857/tensorrt/onnx-tensorrt-build-failure/