cuda 10.1 simpleCudaGraphs doesn't compile

I installed cuda10.1 with the .run file in my $HOME to test it.

After installing cuda I tried to compile the samples but it errored out after a few samples (gcc 5.4.0)

simpleCudaGraphs.cu(286): error: identifier "cudaStreamCaptureModeGlobal" is undefined

simpleCudaGraphs.cu(286): error: too many arguments in function call

2 errors detected in the compilation of "/tmp/tmpxft_00002c32_00000000-14_simpleCudaGraphs.compute_75.cpp1.ii".
Makefile:288: recipe for target 'simpleCudaGraphs.o' failed
make[1]: *** [simpleCudaGraphs.o] Error 1

Only a handful of samples are compiled.

Turns out simpleCudaGraphs is the only culprit. After removing it from the samples folder the rest compiled without problem.

OS is Ubuntu 16.04.6. Graphic card is GTX1070, driver Nvidia 418.39

You’ll get this result if you don’t use CUDA 10.1:

rthoni@rthoni-dt1:simpleCudaGraphs [master]$ make CUDA_PATH=/usr/local/cuda-10.0/
/usr/local/cuda-10.0//bin/nvcc -ccbin g++ -I../../Common  -m64    -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o simpleCudaGraphs.o -c simpleCudaGraphs.cu
simpleCudaGraphs.cu(305): error: identifier "cudaStreamCaptureModeGlobal" is undefined

simpleCudaGraphs.cu(305): error: too many arguments in function call

2 errors detected in the compilation of "/tmp/tmpxft_000004a5_00000000-14_simpleCudaGraphs.compute_75.cpp1.ii".
Makefile:290: recipe for target 'simpleCudaGraphs.o' failed
make: *** [simpleCudaGraphs.o] Error 1
rthoni@rthoni-dt1:simpleCudaGraphs [master]$ make CUDA_PATH=/usr/local/cuda-10.1/
/usr/local/cuda-10.1//bin/nvcc -ccbin g++ -I../../Common  -m64    -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o simpleCudaGraphs.o -c simpleCudaGraphs.cu
/usr/local/cuda-10.1//bin/nvcc -ccbin g++   -m64      -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_75,code=compute_75 -o simpleCudaGraphs simpleCudaGraphs.o 
mkdir -p ../../bin/x86_64/linux/release
cp simpleCudaGraphs ../../bin/x86_64/linux/release

I sorted it. I am testing cuda 10.1 in my $HOME and use a script to preload the environmental variables such as $PATH, $LD_LIBRARY_PATH etc. But forgot to set $CUDA_PATH which is default to /usr/local in these samples’ make file (I don’t think $CUDA_PATH is used anywhere else) Since /usr/local/cuda is at version 10.0, hence the error. Now adding $CUDA_PATH to my script and pointing it to cuda 10.1 solves the problem.