diff --git a/libgomp/plugin/cuda/cuda.h b/include/cuda/cuda.h
similarity index 97%
rename from libgomp/plugin/cuda/cuda.h
rename to include/cuda/cuda.h
index 5c679c1767a..5c813ad2cf8 100644
--- a/libgomp/plugin/cuda/cuda.h
+++ b/include/cuda/cuda.h
@@ -1,4 +1,4 @@
-/* CUDA API description.
+/* CUDA Driver API description.
Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of GCC.
@@ -22,9 +22,8 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
.
-This header provides the minimum amount of typedefs, enums and function
-declarations to be able to compile plugin-nvptx.c if cuda.h and
-libcuda.so.1 are not available. */
+This header provides parts of the CUDA Driver API, without having to rely on
+the proprietary CUDA toolkit. */
#ifndef GCC_CUDA_H
#define GCC_CUDA_H
diff --git a/libgomp/configure b/libgomp/configure
index bdbe3d142d1..5ef071ea046 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -15362,7 +15362,6 @@ rm -f core conftest.err conftest.$ac_objext \
&& (test "x$CUDA_DRIVER_LIB" = x \
|| test "x$CUDA_DRIVER_LIB" = xno); then
PLUGIN_NVPTX=1
- PLUGIN_NVPTX_CPPFLAGS='-I$(srcdir)/plugin/cuda'
PLUGIN_NVPTX_LIBS='-ldl'
PLUGIN_NVPTX_DYNAMIC=1
else
diff --git a/libgomp/plugin/configfrag.ac b/libgomp/plugin/configfrag.ac
index 9f9d0a7f08c..09f87f48bc7 100644
--- a/libgomp/plugin/configfrag.ac
+++ b/libgomp/plugin/configfrag.ac
@@ -197,7 +197,6 @@ if test x"$enable_offload_targets" != x; then
&& (test "x$CUDA_DRIVER_LIB" = x \
|| test "x$CUDA_DRIVER_LIB" = xno); then
PLUGIN_NVPTX=1
- PLUGIN_NVPTX_CPPFLAGS='-I$(srcdir)/plugin/cuda'
PLUGIN_NVPTX_LIBS='-ldl'
PLUGIN_NVPTX_DYNAMIC=1
else
diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c
index b4f0a84d77a..b28dfca00fa 100644
--- a/libgomp/plugin/plugin-nvptx.c
+++ b/libgomp/plugin/plugin-nvptx.c
@@ -41,7 +41,11 @@
#include "oacc-int.h"
#include
-#include
+#if PLUGIN_NVPTX_DYNAMIC
+# include "cuda/cuda.h"
+#else
+# include
+#endif
#include
#include
#include