nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2019 Seungha Yang <seungha.yang@navercorp.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2021-12-08 11:48:08 +00:00
|
|
|
#include "cuda-gst.h"
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
#include "gstcudaloader.h"
|
|
|
|
#include <gmodule.h>
|
2023-02-05 10:50:36 +00:00
|
|
|
#include "gstcuda-private.h"
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2024-07-29 12:49:03 +00:00
|
|
|
#ifdef HAVE_CUDA_GST_GL
|
|
|
|
#include <gst/gl/gstglconfig.h>
|
|
|
|
#if GST_GL_HAVE_PLATFORM_EGL
|
|
|
|
#include <gst/gl/egl/egl.h>
|
|
|
|
#endif /* GST_GL_HAVE_PLATFORM_EGL */
|
|
|
|
#endif /* HAVE_CUDA_GST_GL */
|
|
|
|
|
2021-12-08 11:48:08 +00:00
|
|
|
GST_DEBUG_CATEGORY (gst_cudaloader_debug);
|
|
|
|
#define GST_CAT_DEFAULT gst_cudaloader_debug
|
2019-11-28 09:54:31 +00:00
|
|
|
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
#ifndef G_OS_WIN32
|
|
|
|
#define CUDA_LIBNAME "libcuda.so.1"
|
|
|
|
#else
|
|
|
|
#define CUDA_LIBNAME "nvcuda.dll"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define LOAD_SYMBOL(name,func) G_STMT_START { \
|
|
|
|
if (!g_module_symbol (module, G_STRINGIFY (name), (gpointer *) &vtable->func)) { \
|
|
|
|
GST_ERROR ("Failed to load '%s' from %s, %s", G_STRINGIFY (name), filename, g_module_error()); \
|
2023-02-05 10:50:36 +00:00
|
|
|
g_module_close (module); \
|
|
|
|
return; \
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
} \
|
|
|
|
} G_STMT_END;
|
|
|
|
|
2023-08-09 16:58:57 +00:00
|
|
|
#define LOAD_OPTIONAL_SYMBOL(name,func) G_STMT_START { \
|
|
|
|
if (!g_module_symbol (module, G_STRINGIFY (name), (gpointer *) &vtable->func)) { \
|
|
|
|
GST_WARNING ("Failed to load '%s', %s", G_STRINGIFY (name), g_module_error()); \
|
|
|
|
return; \
|
|
|
|
} \
|
|
|
|
} G_STMT_END;
|
|
|
|
|
2022-03-02 18:24:14 +00:00
|
|
|
/* *INDENT-OFF* */
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
typedef struct _GstNvCodecCudaVTable
|
|
|
|
{
|
|
|
|
gboolean loaded;
|
2023-08-09 16:58:57 +00:00
|
|
|
gboolean have_virtual_alloc;
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuInit) (unsigned int Flags);
|
|
|
|
CUresult (CUDAAPI * CuGetErrorName) (CUresult error, const char **pStr);
|
|
|
|
CUresult (CUDAAPI * CuGetErrorString) (CUresult error, const char **pStr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuCtxCreate) (CUcontext * pctx, unsigned int flags,
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CUdevice dev);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuCtxDestroy) (CUcontext ctx);
|
|
|
|
CUresult (CUDAAPI * CuCtxPopCurrent) (CUcontext * pctx);
|
|
|
|
CUresult (CUDAAPI * CuCtxPushCurrent) (CUcontext ctx);
|
2024-07-29 12:49:03 +00:00
|
|
|
CUresult (CUDAAPI * CuCtxSynchronize) (void);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuCtxEnablePeerAccess) (CUcontext peerContext,
|
2019-08-30 08:19:44 +00:00
|
|
|
unsigned int Flags);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuCtxDisablePeerAccess) (CUcontext peerContext);
|
|
|
|
CUresult (CUDAAPI * CuGraphicsMapResources) (unsigned int count,
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CUgraphicsResource * resources, CUstream hStream);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuGraphicsUnmapResources) (unsigned int count,
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CUgraphicsResource * resources, CUstream hStream);
|
2022-02-28 10:24:31 +00:00
|
|
|
CUresult (CUDAAPI *
|
|
|
|
CuGraphicsResourceSetMapFlags) (CUgraphicsResource resource,
|
|
|
|
unsigned int flags);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuGraphicsSubResourceGetMappedArray) (CUarray * pArray,
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CUgraphicsResource resource, unsigned int arrayIndex,
|
|
|
|
unsigned int mipLevel);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuGraphicsResourceGetMappedPointer) (CUdeviceptr *
|
2020-01-20 09:52:26 +00:00
|
|
|
pDevPtr, size_t * pSize, CUgraphicsResource resource);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI *
|
2020-01-20 09:52:26 +00:00
|
|
|
CuGraphicsUnregisterResource) (CUgraphicsResource resource);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuMemAlloc) (CUdeviceptr * dptr, unsigned int bytesize);
|
|
|
|
CUresult (CUDAAPI * CuMemAllocPitch) (CUdeviceptr * dptr, size_t * pPitch,
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuMemAllocHost) (void **pp, unsigned int bytesize);
|
|
|
|
CUresult (CUDAAPI * CuMemcpy2D) (const CUDA_MEMCPY2D * pCopy);
|
|
|
|
CUresult (CUDAAPI * CuMemcpy2DAsync) (const CUDA_MEMCPY2D * pCopy,
|
2020-01-20 09:52:26 +00:00
|
|
|
CUstream hStream);
|
2024-05-21 09:09:12 +00:00
|
|
|
CUresult (CUDAAPI *CuMemcpyDtoD) (CUdeviceptr dstDevice,
|
|
|
|
CUdeviceptr srcDevice, size_t ByteCount);
|
|
|
|
CUresult (CUDAAPI *CuMemcpyDtoDAsync) (CUdeviceptr dstDevice,
|
|
|
|
CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream);
|
|
|
|
CUresult (CUDAAPI *CuMemcpyDtoH) (void *dstHost, CUdeviceptr srcDevice,
|
|
|
|
size_t ByteCount);
|
|
|
|
CUresult (CUDAAPI *CuMemcpyDtoHAsync) (void *dstHost, CUdeviceptr srcDevice,
|
|
|
|
size_t ByteCount, CUstream hStream);
|
|
|
|
CUresult (CUDAAPI *CuMemcpyHtoD) (CUdeviceptr dstDevice, const void *srcHost,
|
|
|
|
size_t ByteCount);
|
|
|
|
CUresult (CUDAAPI *CuMemcpyHtoDAsync) (CUdeviceptr dstDevice,
|
|
|
|
const void *srcHost, size_t ByteCount, CUstream hStream);
|
2019-08-19 09:02:56 +00:00
|
|
|
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuMemFree) (CUdeviceptr dptr);
|
|
|
|
CUresult (CUDAAPI * CuMemFreeHost) (void *p);
|
2019-08-19 09:02:56 +00:00
|
|
|
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuStreamCreate) (CUstream * phStream,
|
2020-01-20 09:52:26 +00:00
|
|
|
unsigned int Flags);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuStreamDestroy) (CUstream hStream);
|
|
|
|
CUresult (CUDAAPI * CuStreamSynchronize) (CUstream hStream);
|
2020-01-20 09:52:26 +00:00
|
|
|
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuDeviceGet) (CUdevice * device, int ordinal);
|
|
|
|
CUresult (CUDAAPI * CuDeviceGetCount) (int *count);
|
|
|
|
CUresult (CUDAAPI * CuDeviceGetName) (char *name, int len, CUdevice dev);
|
|
|
|
CUresult (CUDAAPI * CuDeviceGetAttribute) (int *pi,
|
2020-01-20 09:52:26 +00:00
|
|
|
CUdevice_attribute attrib, CUdevice dev);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuDeviceCanAccessPeer) (int *canAccessPeer,
|
2019-08-30 08:19:44 +00:00
|
|
|
CUdevice dev, CUdevice peerDev);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuDriverGetVersion) (int *driverVersion);
|
2019-10-16 13:42:39 +00:00
|
|
|
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuModuleLoadData) (CUmodule * module,
|
2019-10-16 13:42:39 +00:00
|
|
|
const void *image);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuModuleUnload) (CUmodule module);
|
|
|
|
CUresult (CUDAAPI * CuModuleGetFunction) (CUfunction * hfunc,
|
2019-10-16 13:42:39 +00:00
|
|
|
CUmodule hmod, const char *name);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuTexObjectCreate) (CUtexObject * pTexObject,
|
2019-10-16 13:42:39 +00:00
|
|
|
const CUDA_RESOURCE_DESC * pResDesc, const CUDA_TEXTURE_DESC * pTexDesc,
|
|
|
|
const CUDA_RESOURCE_VIEW_DESC * pResViewDesc);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuTexObjectDestroy) (CUtexObject texObject);
|
|
|
|
CUresult (CUDAAPI * CuLaunchKernel) (CUfunction f, unsigned int gridDimX,
|
2019-10-16 13:42:39 +00:00
|
|
|
unsigned int gridDimY, unsigned int gridDimZ,
|
|
|
|
unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ,
|
|
|
|
unsigned int sharedMemBytes, CUstream hStream, void **kernelParams,
|
|
|
|
void **extra);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuGraphicsGLRegisterImage) (CUgraphicsResource *
|
2020-01-20 09:52:26 +00:00
|
|
|
pCudaResource, unsigned int image, unsigned int target,
|
|
|
|
unsigned int Flags);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuGraphicsGLRegisterBuffer) (CUgraphicsResource *
|
2020-01-20 09:52:26 +00:00
|
|
|
pCudaResource, unsigned int buffer, unsigned int Flags);
|
2022-03-02 18:24:14 +00:00
|
|
|
CUresult (CUDAAPI * CuGLGetDevices) (unsigned int *pCudaDeviceCount,
|
2020-03-15 10:20:47 +00:00
|
|
|
CUdevice * pCudaDevices, unsigned int cudaDeviceCount,
|
|
|
|
CUGLDeviceList deviceList);
|
2022-02-28 10:24:31 +00:00
|
|
|
|
2024-07-29 12:49:03 +00:00
|
|
|
#if defined(HAVE_CUDA_NVMM_JETSON) && GST_GL_HAVE_PLATFORM_EGL
|
|
|
|
CUresult (CUDAAPI* CuGraphicsEGLRegisterImage) (CUgraphicsResource *
|
|
|
|
pCudaResource, EGLImageKHR image, unsigned int flags);
|
|
|
|
CUresult (CUDAAPI* CuGraphicsResourceGetMappedEglFrame)
|
|
|
|
(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index,
|
|
|
|
unsigned int mipLevel);
|
|
|
|
#endif
|
|
|
|
|
2023-08-09 16:58:57 +00:00
|
|
|
CUresult (CUDAAPI * CuEventCreate) (CUevent *phEvent, unsigned int Flags);
|
|
|
|
CUresult (CUDAAPI * CuEventDestroy) (CUevent hEvent);
|
|
|
|
CUresult (CUDAAPI * CuEventRecord) (CUevent hEvent, CUstream hStream);
|
|
|
|
CUresult (CUDAAPI * CuEventSynchronize) (CUevent hEvent);
|
|
|
|
|
|
|
|
CUresult (CUDAAPI * CuIpcGetEventHandle) (CUipcEventHandle *pHandle,
|
|
|
|
CUevent event);
|
|
|
|
CUresult (CUDAAPI * CuIpcOpenEventHandle) (CUevent* phEvent,
|
|
|
|
CUipcEventHandle handle);
|
|
|
|
|
|
|
|
CUresult (CUDAAPI * CuIpcGetMemHandle) (CUipcMemHandle *pHandle,
|
|
|
|
CUdeviceptr dptr);
|
|
|
|
CUresult (CUDAAPI * CuIpcOpenMemHandle) (CUdeviceptr *pdptr,
|
|
|
|
CUipcMemHandle handle, unsigned int Flags);
|
|
|
|
CUresult (CUDAAPI * CuIpcCloseMemHandle) (CUdeviceptr dptr);
|
|
|
|
|
2022-09-12 16:02:50 +00:00
|
|
|
#ifdef G_OS_WIN32
|
2022-02-28 10:24:31 +00:00
|
|
|
CUresult (CUDAAPI * CuGraphicsD3D11RegisterResource) (CUgraphicsResource *
|
2022-09-12 16:02:50 +00:00
|
|
|
pCudaResource, ID3D11Resource * pD3DResource, unsigned int Flags);
|
2022-02-28 10:24:31 +00:00
|
|
|
CUresult (CUDAAPI * CuD3D11GetDevice) (CUdevice * device,
|
2022-09-12 16:02:50 +00:00
|
|
|
IDXGIAdapter * pAdapter);
|
2022-02-28 10:24:31 +00:00
|
|
|
CUresult (CUDAAPI * CuD3D11GetDevices) (unsigned int *pCudaDeviceCount,
|
|
|
|
CUdevice * pCudaDevices, unsigned int cudaDeviceCount,
|
2022-09-12 16:02:50 +00:00
|
|
|
ID3D11Device * pD3D11Device, CUd3d11DeviceList deviceList);
|
|
|
|
#endif
|
2023-08-09 16:58:57 +00:00
|
|
|
|
|
|
|
CUresult (CUDAAPI * CuMemAddressReserve) (CUdeviceptr *ptr, size_t size,
|
|
|
|
size_t alignment, CUdeviceptr addr, unsigned long long flags);
|
|
|
|
CUresult (CUDAAPI * CuMemAddressFree) (CUdeviceptr ptr, size_t size);
|
|
|
|
CUresult (CUDAAPI * CuMemCreate) (CUmemGenericAllocationHandle *handle,
|
|
|
|
size_t size, const CUmemAllocationProp *prop, unsigned long long flags);
|
|
|
|
CUresult (CUDAAPI * CuMemRelease) (CUmemGenericAllocationHandle handle);
|
|
|
|
CUresult (CUDAAPI * CuMemExportToShareableHandle) (void *shareableHandle,
|
|
|
|
CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType,
|
|
|
|
unsigned long long flags);
|
|
|
|
CUresult (CUDAAPI * CuMemImportFromShareableHandle)
|
|
|
|
(CUmemGenericAllocationHandle *handle, void *osHandle,
|
|
|
|
CUmemAllocationHandleType shHandleType);
|
|
|
|
CUresult (CUDAAPI * CuMemSetAccess) (CUdeviceptr ptr, size_t size,
|
|
|
|
const CUmemAccessDesc *desc, size_t count);
|
|
|
|
CUresult (CUDAAPI * CuMemGetAccess) (unsigned long long *flags,
|
|
|
|
const CUmemLocation *location, CUdeviceptr ptr);
|
|
|
|
CUresult (CUDAAPI * CuMemGetAllocationGranularity) (size_t *granularity,
|
|
|
|
const CUmemAllocationProp *prop, CUmemAllocationGranularity_flags option);
|
|
|
|
CUresult (CUDAAPI * CuMemGetAllocationPropertiesFromHandle)
|
|
|
|
(CUmemAllocationProp *prop, CUmemGenericAllocationHandle handle);
|
|
|
|
CUresult (CUDAAPI * CuMemMap) (CUdeviceptr ptr, size_t size, size_t offset,
|
|
|
|
CUmemGenericAllocationHandle handle, unsigned long long flags);
|
|
|
|
CUresult (CUDAAPI * CuMemUnmap) (CUdeviceptr ptr, size_t size);
|
|
|
|
CUresult (CUDAAPI * CuMemRetainAllocationHandle)
|
|
|
|
(CUmemGenericAllocationHandle *handle, void *addr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
} GstNvCodecCudaVTable;
|
2022-03-02 18:24:14 +00:00
|
|
|
/* *INDENT-ON* */
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
static GstNvCodecCudaVTable gst_cuda_vtable = { 0, };
|
|
|
|
|
2023-08-09 16:58:57 +00:00
|
|
|
static void
|
|
|
|
gst_cuda_load_optional_symbols (GModule * module)
|
|
|
|
{
|
|
|
|
GstNvCodecCudaVTable *vtable = &gst_cuda_vtable;
|
|
|
|
|
|
|
|
LOAD_OPTIONAL_SYMBOL (cuMemAddressReserve, CuMemAddressReserve);
|
|
|
|
LOAD_OPTIONAL_SYMBOL (cuMemAddressFree, CuMemAddressFree);
|
|
|
|
LOAD_OPTIONAL_SYMBOL (cuMemCreate, CuMemCreate);
|
|
|
|
LOAD_OPTIONAL_SYMBOL (cuMemRelease, CuMemRelease);
|
|
|
|
LOAD_OPTIONAL_SYMBOL (cuMemExportToShareableHandle,
|
|
|
|
CuMemExportToShareableHandle);
|
|
|
|
LOAD_OPTIONAL_SYMBOL (cuMemImportFromShareableHandle,
|
|
|
|
CuMemImportFromShareableHandle);
|
|
|
|
LOAD_OPTIONAL_SYMBOL (cuMemSetAccess, CuMemSetAccess);
|
|
|
|
LOAD_OPTIONAL_SYMBOL (cuMemGetAccess, CuMemGetAccess);
|
|
|
|
LOAD_OPTIONAL_SYMBOL (cuMemGetAllocationGranularity,
|
|
|
|
CuMemGetAllocationGranularity);
|
|
|
|
LOAD_OPTIONAL_SYMBOL (cuMemGetAllocationPropertiesFromHandle,
|
|
|
|
CuMemGetAllocationPropertiesFromHandle);
|
|
|
|
LOAD_OPTIONAL_SYMBOL (cuMemMap, CuMemMap);
|
|
|
|
LOAD_OPTIONAL_SYMBOL (cuMemUnmap, CuMemUnmap);
|
|
|
|
LOAD_OPTIONAL_SYMBOL (cuMemRetainAllocationHandle,
|
|
|
|
CuMemRetainAllocationHandle);
|
|
|
|
|
|
|
|
GST_INFO ("Virtual alloc symbols are loaded");
|
|
|
|
|
|
|
|
vtable->have_virtual_alloc = TRUE;
|
|
|
|
}
|
|
|
|
|
2023-02-05 10:50:36 +00:00
|
|
|
static void
|
|
|
|
gst_cuda_load_library_once_func (void)
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
{
|
|
|
|
GModule *module;
|
|
|
|
const gchar *filename = CUDA_LIBNAME;
|
|
|
|
GstNvCodecCudaVTable *vtable;
|
|
|
|
|
2023-03-10 21:21:42 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (gst_cudaloader_debug, "cudaloader", 0,
|
|
|
|
"CUDA plugin loader");
|
|
|
|
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
module = g_module_open (filename, G_MODULE_BIND_LAZY);
|
2023-02-05 10:50:36 +00:00
|
|
|
if (module == nullptr) {
|
2019-07-24 04:06:16 +00:00
|
|
|
GST_WARNING ("Could not open library %s, %s", filename, g_module_error ());
|
2023-02-05 10:50:36 +00:00
|
|
|
return;
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
vtable = &gst_cuda_vtable;
|
|
|
|
|
|
|
|
/* cuda.h */
|
|
|
|
LOAD_SYMBOL (cuInit, CuInit);
|
|
|
|
LOAD_SYMBOL (cuGetErrorName, CuGetErrorName);
|
|
|
|
LOAD_SYMBOL (cuGetErrorString, CuGetErrorString);
|
|
|
|
LOAD_SYMBOL (cuCtxCreate, CuCtxCreate);
|
|
|
|
LOAD_SYMBOL (cuCtxDestroy, CuCtxDestroy);
|
|
|
|
LOAD_SYMBOL (cuCtxPopCurrent, CuCtxPopCurrent);
|
2024-07-29 12:49:03 +00:00
|
|
|
LOAD_SYMBOL (cuCtxSynchronize, CuCtxSynchronize);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
LOAD_SYMBOL (cuCtxPushCurrent, CuCtxPushCurrent);
|
2019-08-30 08:19:44 +00:00
|
|
|
LOAD_SYMBOL (cuCtxEnablePeerAccess, CuCtxEnablePeerAccess);
|
|
|
|
LOAD_SYMBOL (cuCtxDisablePeerAccess, CuCtxDisablePeerAccess);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
LOAD_SYMBOL (cuGraphicsMapResources, CuGraphicsMapResources);
|
|
|
|
LOAD_SYMBOL (cuGraphicsUnmapResources, CuGraphicsUnmapResources);
|
2022-02-28 10:24:31 +00:00
|
|
|
LOAD_SYMBOL (cuGraphicsResourceSetMapFlags, CuGraphicsResourceSetMapFlags);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
LOAD_SYMBOL (cuGraphicsSubResourceGetMappedArray,
|
|
|
|
CuGraphicsSubResourceGetMappedArray);
|
|
|
|
LOAD_SYMBOL (cuGraphicsResourceGetMappedPointer,
|
|
|
|
CuGraphicsResourceGetMappedPointer);
|
|
|
|
LOAD_SYMBOL (cuGraphicsUnregisterResource, CuGraphicsUnregisterResource);
|
|
|
|
|
|
|
|
LOAD_SYMBOL (cuMemAlloc, CuMemAlloc);
|
|
|
|
LOAD_SYMBOL (cuMemAllocPitch, CuMemAllocPitch);
|
2019-08-19 09:02:56 +00:00
|
|
|
LOAD_SYMBOL (cuMemAllocHost, CuMemAllocHost);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
LOAD_SYMBOL (cuMemcpy2D, CuMemcpy2D);
|
2019-07-19 13:46:01 +00:00
|
|
|
LOAD_SYMBOL (cuMemcpy2DAsync, CuMemcpy2DAsync);
|
2024-05-21 09:09:12 +00:00
|
|
|
LOAD_SYMBOL (cuMemcpyDtoD, CuMemcpyDtoD);
|
|
|
|
LOAD_SYMBOL (cuMemcpyDtoDAsync, CuMemcpyDtoDAsync);
|
|
|
|
LOAD_SYMBOL (cuMemcpyDtoH, CuMemcpyDtoH);
|
|
|
|
LOAD_SYMBOL (cuMemcpyDtoHAsync, CuMemcpyDtoHAsync);
|
|
|
|
LOAD_SYMBOL (cuMemcpyHtoD, CuMemcpyHtoD);
|
|
|
|
LOAD_SYMBOL (cuMemcpyHtoDAsync, CuMemcpyHtoDAsync);
|
2019-08-19 09:02:56 +00:00
|
|
|
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
LOAD_SYMBOL (cuMemFree, CuMemFree);
|
2019-08-19 09:02:56 +00:00
|
|
|
LOAD_SYMBOL (cuMemFreeHost, CuMemFreeHost);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2019-08-18 13:07:38 +00:00
|
|
|
LOAD_SYMBOL (cuStreamCreate, CuStreamCreate);
|
|
|
|
LOAD_SYMBOL (cuStreamDestroy, CuStreamDestroy);
|
2019-07-19 13:46:01 +00:00
|
|
|
LOAD_SYMBOL (cuStreamSynchronize, CuStreamSynchronize);
|
|
|
|
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
LOAD_SYMBOL (cuDeviceGet, CuDeviceGet);
|
|
|
|
LOAD_SYMBOL (cuDeviceGetCount, CuDeviceGetCount);
|
|
|
|
LOAD_SYMBOL (cuDeviceGetName, CuDeviceGetName);
|
|
|
|
LOAD_SYMBOL (cuDeviceGetAttribute, CuDeviceGetAttribute);
|
2019-08-30 08:19:44 +00:00
|
|
|
LOAD_SYMBOL (cuDeviceCanAccessPeer, CuDeviceCanAccessPeer);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2019-10-16 13:42:39 +00:00
|
|
|
LOAD_SYMBOL (cuDriverGetVersion, CuDriverGetVersion);
|
|
|
|
|
|
|
|
LOAD_SYMBOL (cuModuleLoadData, CuModuleLoadData);
|
|
|
|
LOAD_SYMBOL (cuModuleUnload, CuModuleUnload);
|
|
|
|
LOAD_SYMBOL (cuModuleGetFunction, CuModuleGetFunction);
|
|
|
|
LOAD_SYMBOL (cuTexObjectCreate, CuTexObjectCreate);
|
|
|
|
LOAD_SYMBOL (cuTexObjectDestroy, CuTexObjectDestroy);
|
|
|
|
LOAD_SYMBOL (cuLaunchKernel, CuLaunchKernel);
|
|
|
|
|
2023-08-09 16:58:57 +00:00
|
|
|
LOAD_SYMBOL (cuEventCreate, CuEventCreate);
|
|
|
|
LOAD_SYMBOL (cuEventDestroy, CuEventDestroy);
|
|
|
|
LOAD_SYMBOL (cuEventRecord, CuEventRecord);
|
|
|
|
LOAD_SYMBOL (cuEventSynchronize, CuEventSynchronize);
|
|
|
|
|
|
|
|
LOAD_SYMBOL (cuIpcGetEventHandle, CuIpcGetEventHandle);
|
|
|
|
LOAD_SYMBOL (cuIpcOpenEventHandle, CuIpcOpenEventHandle);
|
|
|
|
|
|
|
|
LOAD_SYMBOL (cuIpcGetMemHandle, CuIpcGetMemHandle);
|
|
|
|
LOAD_SYMBOL (cuIpcOpenMemHandle, CuIpcOpenMemHandle);
|
|
|
|
LOAD_SYMBOL (cuIpcCloseMemHandle, CuIpcCloseMemHandle);
|
|
|
|
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
/* cudaGL.h */
|
|
|
|
LOAD_SYMBOL (cuGraphicsGLRegisterImage, CuGraphicsGLRegisterImage);
|
|
|
|
LOAD_SYMBOL (cuGraphicsGLRegisterBuffer, CuGraphicsGLRegisterBuffer);
|
2020-03-15 10:20:47 +00:00
|
|
|
LOAD_SYMBOL (cuGLGetDevices, CuGLGetDevices);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2024-07-29 12:49:03 +00:00
|
|
|
/* cudaEGL.h */
|
|
|
|
#if defined(HAVE_CUDA_NVMM_JETSON) && GST_GL_HAVE_PLATFORM_EGL
|
|
|
|
LOAD_SYMBOL (cuGraphicsEGLRegisterImage, CuGraphicsEGLRegisterImage);
|
|
|
|
LOAD_SYMBOL (cuGraphicsResourceGetMappedEglFrame,
|
|
|
|
CuGraphicsResourceGetMappedEglFrame);
|
|
|
|
#endif
|
|
|
|
|
2022-09-12 16:02:50 +00:00
|
|
|
#ifdef G_OS_WIN32
|
2022-02-28 10:24:31 +00:00
|
|
|
/* cudaD3D11.h */
|
|
|
|
LOAD_SYMBOL (cuGraphicsD3D11RegisterResource,
|
|
|
|
CuGraphicsD3D11RegisterResource);
|
|
|
|
LOAD_SYMBOL (cuD3D11GetDevice, CuD3D11GetDevice);
|
|
|
|
LOAD_SYMBOL (cuD3D11GetDevices, CuD3D11GetDevices);
|
|
|
|
#endif
|
|
|
|
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
vtable->loaded = TRUE;
|
2023-08-09 16:58:57 +00:00
|
|
|
|
|
|
|
gst_cuda_load_optional_symbols (module);
|
2023-02-05 10:50:36 +00:00
|
|
|
}
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2023-02-05 10:50:36 +00:00
|
|
|
/**
|
|
|
|
* gst_cuda_load_library:
|
|
|
|
*
|
|
|
|
* Loads the cuda library
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the libcuda could be loaded %FALSE otherwise
|
|
|
|
*
|
|
|
|
* Since: 1.22
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gst_cuda_load_library (void)
|
|
|
|
{
|
|
|
|
GST_CUDA_CALL_ONCE_BEGIN {
|
|
|
|
gst_cuda_load_library_once_func ();
|
|
|
|
} GST_CUDA_CALL_ONCE_END;
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2023-02-05 10:50:36 +00:00
|
|
|
return gst_cuda_vtable.loaded;
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
}
|
|
|
|
|
2023-08-09 16:58:57 +00:00
|
|
|
gboolean
|
|
|
|
gst_cuda_virtual_memory_symbol_loaded (void)
|
|
|
|
{
|
|
|
|
gst_cuda_load_library ();
|
|
|
|
|
|
|
|
return gst_cuda_vtable.have_virtual_alloc;
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuInit (unsigned int Flags)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuInit != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuInit (Flags);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGetErrorName (CUresult error, const char **pStr)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuGetErrorName != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGetErrorName (error, pStr);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGetErrorString (CUresult error, const char **pStr)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuGetErrorString != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGetErrorString (error, pStr);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuCtxCreate (CUcontext * pctx, unsigned int flags, CUdevice dev)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuCtxCreate != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuCtxCreate (pctx, flags, dev);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuCtxDestroy (CUcontext ctx)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuCtxDestroy != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuCtxDestroy (ctx);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuCtxPopCurrent (CUcontext * pctx)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuCtxPopCurrent != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuCtxPopCurrent (pctx);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuCtxPushCurrent (CUcontext ctx)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuCtxPushCurrent != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuCtxPushCurrent (ctx);
|
|
|
|
}
|
|
|
|
|
2024-07-29 12:49:03 +00:00
|
|
|
CUresult CUDAAPI
|
|
|
|
CuCtxSynchronize (void)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuCtxSynchronize != nullptr);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuCtxSynchronize ();
|
|
|
|
}
|
|
|
|
|
2019-08-30 08:19:44 +00:00
|
|
|
CUresult CUDAAPI
|
|
|
|
CuCtxEnablePeerAccess (CUcontext peerContext, unsigned int Flags)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuCtxEnablePeerAccess != nullptr);
|
2019-08-30 08:19:44 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuCtxEnablePeerAccess (peerContext, Flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuCtxDisablePeerAccess (CUcontext peerContext)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuCtxDisablePeerAccess != nullptr);
|
2019-08-30 08:19:44 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuCtxDisablePeerAccess (peerContext);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsMapResources (unsigned int count, CUgraphicsResource * resources,
|
|
|
|
CUstream hStream)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsMapResources != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsMapResources (count, resources, hStream);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsUnmapResources (unsigned int count, CUgraphicsResource * resources,
|
|
|
|
CUstream hStream)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsUnmapResources != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsUnmapResources (count, resources, hStream);
|
|
|
|
}
|
|
|
|
|
2022-02-28 10:24:31 +00:00
|
|
|
CUresult CUDAAPI
|
|
|
|
CuGraphicsResourceSetMapFlags (CUgraphicsResource resource, unsigned int flags)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsResourceSetMapFlags != nullptr);
|
2022-02-28 10:24:31 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsResourceSetMapFlags (resource, flags);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsSubResourceGetMappedArray (CUarray * pArray,
|
|
|
|
CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsSubResourceGetMappedArray != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsSubResourceGetMappedArray (pArray, resource,
|
|
|
|
arrayIndex, mipLevel);
|
|
|
|
}
|
|
|
|
|
2022-03-02 18:24:14 +00:00
|
|
|
/* *INDENT-OFF* */
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsResourceGetMappedPointer (CUdeviceptr * pDevPtr, size_t * pSize,
|
|
|
|
CUgraphicsResource resource)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsResourceGetMappedPointer != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsResourceGetMappedPointer (pDevPtr, pSize,
|
|
|
|
resource);
|
|
|
|
}
|
2022-03-02 18:24:14 +00:00
|
|
|
/* *INDENT-ON* */
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsUnregisterResource (CUgraphicsResource resource)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsUnregisterResource != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsUnregisterResource (resource);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuMemAlloc (CUdeviceptr * dptr, unsigned int bytesize)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuMemAlloc != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemAlloc (dptr, bytesize);
|
|
|
|
}
|
|
|
|
|
2022-03-02 18:24:14 +00:00
|
|
|
/* *INDENT-OFF* */
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuMemAllocPitch (CUdeviceptr * dptr, size_t * pPitch, size_t WidthInBytes,
|
|
|
|
size_t Height, unsigned int ElementSizeBytes)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuMemAllocPitch != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemAllocPitch (dptr, pPitch, WidthInBytes, Height,
|
|
|
|
ElementSizeBytes);
|
|
|
|
}
|
2022-03-02 18:24:14 +00:00
|
|
|
/* *INDENT-ON* */
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2019-08-19 09:02:56 +00:00
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemAllocHost (void **pp, unsigned int bytesize)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuMemAllocHost != nullptr);
|
2019-08-19 09:02:56 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemAllocHost (pp, bytesize);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuMemcpy2D (const CUDA_MEMCPY2D * pCopy)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuMemcpy2D != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemcpy2D (pCopy);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
2019-07-19 13:46:01 +00:00
|
|
|
CuMemcpy2DAsync (const CUDA_MEMCPY2D * pCopy, CUstream hStream)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuMemcpy2DAsync != nullptr);
|
2019-07-19 13:46:01 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemcpy2DAsync (pCopy, hStream);
|
|
|
|
}
|
|
|
|
|
2024-05-21 09:09:12 +00:00
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemcpyDtoD (CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuMemcpyDtoD != nullptr);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemcpyDtoD (dstDevice, srcDevice, ByteCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemcpyDtoDAsync (CUdeviceptr dstDevice, CUdeviceptr srcDevice,
|
|
|
|
size_t ByteCount, CUstream hStream)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuMemcpyDtoDAsync != nullptr);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemcpyDtoDAsync (dstDevice, srcDevice, ByteCount,
|
|
|
|
hStream);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemcpyDtoH (void *dstHost, CUdeviceptr srcDevice, size_t ByteCount)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuMemcpyDtoH != nullptr);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemcpyDtoH (dstHost, srcDevice, ByteCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemcpyDtoHAsync (void *dstHost, CUdeviceptr srcDevice, size_t ByteCount,
|
|
|
|
CUstream hStream)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuMemcpyDtoHAsync != nullptr);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemcpyDtoHAsync (dstHost, srcDevice, ByteCount,
|
|
|
|
hStream);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemcpyHtoD (CUdeviceptr dstDevice, const void *srcHost, size_t ByteCount)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuMemcpyHtoD != nullptr);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemcpyHtoD (dstDevice, srcHost, ByteCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemcpyHtoDAsync (CUdeviceptr dstDevice, const void *srcHost,
|
|
|
|
size_t ByteCount, CUstream hStream)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuMemcpyHtoD != nullptr);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemcpyHtoDAsync (dstDevice, srcHost, ByteCount,
|
|
|
|
hStream);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuMemFree (CUdeviceptr dptr)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuMemFree != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemFree (dptr);
|
|
|
|
}
|
|
|
|
|
2019-08-19 09:02:56 +00:00
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemFreeHost (void *p)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuMemFreeHost != nullptr);
|
2019-08-19 09:02:56 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemFreeHost (p);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
2019-08-18 13:07:38 +00:00
|
|
|
CuStreamCreate (CUstream * phStream, unsigned int Flags)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuStreamCreate != nullptr);
|
2019-08-18 13:07:38 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuStreamCreate (phStream, Flags);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
2019-08-18 13:07:38 +00:00
|
|
|
CuStreamDestroy (CUstream hStream)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuStreamDestroy != nullptr);
|
2019-08-18 13:07:38 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuStreamDestroy (hStream);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
2019-07-19 13:46:01 +00:00
|
|
|
CuStreamSynchronize (CUstream hStream)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuStreamSynchronize != nullptr);
|
2019-07-19 13:46:01 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuStreamSynchronize (hStream);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuDeviceGet (CUdevice * device, int ordinal)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuDeviceGet != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuDeviceGet (device, ordinal);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuDeviceGetCount (int *count)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuDeviceGetCount != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuDeviceGetCount (count);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuDeviceGetName (char *name, int len, CUdevice dev)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuDeviceGetName != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuDeviceGetName (name, len, dev);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuDeviceGetAttribute (int *pi, CUdevice_attribute attrib, CUdevice dev)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuDeviceGetAttribute != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuDeviceGetAttribute (pi, attrib, dev);
|
|
|
|
}
|
|
|
|
|
2019-08-30 08:19:44 +00:00
|
|
|
CUresult CUDAAPI
|
|
|
|
CuDeviceCanAccessPeer (int *canAccessPeer, CUdevice dev, CUdevice peerDev)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuDeviceCanAccessPeer != nullptr);
|
2019-08-30 08:19:44 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuDeviceCanAccessPeer (canAccessPeer, dev, peerDev);
|
|
|
|
}
|
|
|
|
|
2019-10-16 13:42:39 +00:00
|
|
|
CUresult CUDAAPI
|
|
|
|
CuDriverGetVersion (int *driverVersion)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuDriverGetVersion != nullptr);
|
2019-10-16 13:42:39 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuDriverGetVersion (driverVersion);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuModuleLoadData (CUmodule * module, const void *image)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuModuleLoadData != nullptr);
|
2019-10-16 13:42:39 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuModuleLoadData (module, image);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuModuleUnload (CUmodule module)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuModuleUnload != nullptr);
|
2019-10-16 13:42:39 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuModuleUnload (module);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuModuleGetFunction (CUfunction * hfunc, CUmodule hmod, const char *name)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuModuleGetFunction != nullptr);
|
2019-10-16 13:42:39 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuModuleGetFunction (hfunc, hmod, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuTexObjectCreate (CUtexObject * pTexObject,
|
|
|
|
const CUDA_RESOURCE_DESC * pResDesc, const CUDA_TEXTURE_DESC * pTexDesc,
|
|
|
|
const CUDA_RESOURCE_VIEW_DESC * pResViewDesc)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuTexObjectCreate != nullptr);
|
2019-10-16 13:42:39 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuTexObjectCreate (pTexObject, pResDesc, pTexDesc,
|
|
|
|
pResViewDesc);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuTexObjectDestroy (CUtexObject texObject)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuTexObjectDestroy != nullptr);
|
2019-10-16 13:42:39 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuTexObjectDestroy (texObject);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuLaunchKernel (CUfunction f, unsigned int gridDimX,
|
|
|
|
unsigned int gridDimY, unsigned int gridDimZ,
|
|
|
|
unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ,
|
|
|
|
unsigned int sharedMemBytes, CUstream hStream, void **kernelParams,
|
|
|
|
void **extra)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuLaunchKernel != nullptr);
|
2019-10-16 13:42:39 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuLaunchKernel (f, gridDimX, gridDimY, gridDimZ,
|
|
|
|
blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams,
|
|
|
|
extra);
|
|
|
|
}
|
|
|
|
|
2023-08-09 16:58:57 +00:00
|
|
|
CUresult CUDAAPI
|
|
|
|
CuEventCreate (CUevent * phEvent, unsigned int Flags)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuEventCreate);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuEventCreate (phEvent, Flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuEventDestroy (CUevent hEvent)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuEventDestroy);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuEventDestroy (hEvent);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuEventRecord (CUevent hEvent, CUstream hStream)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuEventRecord);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuEventRecord (hEvent, hStream);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuEventSynchronize (CUevent hEvent)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuEventSynchronize);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuEventSynchronize (hEvent);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuIpcGetEventHandle (CUipcEventHandle * pHandle, CUevent event)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuIpcGetEventHandle);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuIpcGetEventHandle (pHandle, event);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuIpcOpenEventHandle (CUevent * phEvent, CUipcEventHandle handle)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuIpcOpenEventHandle);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuIpcOpenEventHandle (phEvent, handle);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuIpcGetMemHandle (CUipcMemHandle * pHandle, CUdeviceptr dptr)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuIpcGetMemHandle);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuIpcGetMemHandle (pHandle, dptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuIpcOpenMemHandle (CUdeviceptr * pdptr, CUipcMemHandle handle,
|
|
|
|
unsigned int Flags)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuIpcOpenMemHandle);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuIpcOpenMemHandle (pdptr, handle, Flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuIpcCloseMemHandle (CUdeviceptr dptr)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuIpcCloseMemHandle);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuIpcCloseMemHandle (dptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemAddressReserve (CUdeviceptr * ptr, size_t size, size_t alignment,
|
|
|
|
CUdeviceptr addr, unsigned long long flags)
|
|
|
|
{
|
|
|
|
if (!gst_cuda_vtable.CuMemAddressReserve)
|
|
|
|
return CUDA_ERROR_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemAddressReserve (ptr,
|
|
|
|
size, alignment, addr, flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemAddressFree (CUdeviceptr ptr, size_t size)
|
|
|
|
{
|
|
|
|
if (!gst_cuda_vtable.CuMemAddressFree)
|
|
|
|
return CUDA_ERROR_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemAddressFree (ptr, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemCreate (CUmemGenericAllocationHandle * handle, size_t size,
|
|
|
|
const CUmemAllocationProp * prop, unsigned long long flags)
|
|
|
|
{
|
|
|
|
if (!gst_cuda_vtable.CuMemCreate)
|
|
|
|
return CUDA_ERROR_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemCreate (handle, size, prop, flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemRelease (CUmemGenericAllocationHandle handle)
|
|
|
|
{
|
|
|
|
if (!gst_cuda_vtable.CuMemRelease)
|
|
|
|
return CUDA_ERROR_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemRelease (handle);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemExportToShareableHandle (void *shareableHandle,
|
|
|
|
CUmemGenericAllocationHandle handle, CUmemAllocationHandleType handleType,
|
|
|
|
unsigned long long flags)
|
|
|
|
{
|
|
|
|
if (!gst_cuda_vtable.CuMemExportToShareableHandle)
|
|
|
|
return CUDA_ERROR_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemExportToShareableHandle (shareableHandle,
|
|
|
|
handle, handleType, flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemImportFromShareableHandle (CUmemGenericAllocationHandle * handle,
|
|
|
|
void *osHandle, CUmemAllocationHandleType shHandleType)
|
|
|
|
{
|
|
|
|
if (!gst_cuda_vtable.CuMemImportFromShareableHandle)
|
|
|
|
return CUDA_ERROR_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemImportFromShareableHandle (handle,
|
|
|
|
osHandle, shHandleType);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemSetAccess (CUdeviceptr ptr, size_t size, const CUmemAccessDesc * desc,
|
|
|
|
size_t count)
|
|
|
|
{
|
|
|
|
if (!gst_cuda_vtable.CuMemSetAccess)
|
|
|
|
return CUDA_ERROR_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemSetAccess (ptr, size, desc, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemGetAccess (unsigned long long *flags, const CUmemLocation * location,
|
|
|
|
CUdeviceptr ptr)
|
|
|
|
{
|
|
|
|
if (!gst_cuda_vtable.CuMemGetAccess)
|
|
|
|
return CUDA_ERROR_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemGetAccess (flags, location, ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemGetAllocationGranularity (size_t *granularity,
|
|
|
|
const CUmemAllocationProp * prop, CUmemAllocationGranularity_flags option)
|
|
|
|
{
|
|
|
|
if (!gst_cuda_vtable.CuMemGetAllocationGranularity)
|
|
|
|
return CUDA_ERROR_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemGetAllocationGranularity (granularity,
|
|
|
|
prop, option);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemGetAllocationPropertiesFromHandle (CUmemAllocationProp * prop,
|
|
|
|
CUmemGenericAllocationHandle handle)
|
|
|
|
{
|
|
|
|
if (!gst_cuda_vtable.CuMemGetAllocationPropertiesFromHandle)
|
|
|
|
return CUDA_ERROR_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemGetAllocationPropertiesFromHandle (prop, handle);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemMap (CUdeviceptr ptr, size_t size, size_t offset,
|
|
|
|
CUmemGenericAllocationHandle handle, unsigned long long flags)
|
|
|
|
{
|
|
|
|
if (!gst_cuda_vtable.CuMemMap)
|
|
|
|
return CUDA_ERROR_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemMap (ptr, size, offset, handle, flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemUnmap (CUdeviceptr ptr, size_t size)
|
|
|
|
{
|
|
|
|
if (!gst_cuda_vtable.CuMemUnmap)
|
|
|
|
return CUDA_ERROR_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemUnmap (ptr, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuMemRetainAllocationHandle (CUmemGenericAllocationHandle * handle, void *addr)
|
|
|
|
{
|
|
|
|
if (!gst_cuda_vtable.CuMemRetainAllocationHandle)
|
|
|
|
return CUDA_ERROR_NOT_SUPPORTED;
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemRetainAllocationHandle (handle, addr);
|
|
|
|
}
|
|
|
|
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
/* cudaGL.h */
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsGLRegisterImage (CUgraphicsResource * pCudaResource,
|
|
|
|
unsigned int image, unsigned int target, unsigned int Flags)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsGLRegisterImage != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsGLRegisterImage (pCudaResource, image,
|
|
|
|
target, Flags);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsGLRegisterBuffer (CUgraphicsResource * pCudaResource,
|
|
|
|
unsigned int buffer, unsigned int Flags)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsGLRegisterBuffer != nullptr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsGLRegisterBuffer (pCudaResource, buffer,
|
|
|
|
Flags);
|
|
|
|
}
|
2019-08-17 08:45:44 +00:00
|
|
|
|
2020-03-15 10:20:47 +00:00
|
|
|
CUresult CUDAAPI
|
|
|
|
CuGLGetDevices (unsigned int *pCudaDeviceCount, CUdevice * pCudaDevices,
|
|
|
|
unsigned int cudaDeviceCount, CUGLDeviceList deviceList)
|
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuGLGetDevices != nullptr);
|
2020-03-15 10:20:47 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGLGetDevices (pCudaDeviceCount, pCudaDevices,
|
|
|
|
cudaDeviceCount, deviceList);
|
|
|
|
}
|
2022-02-28 10:24:31 +00:00
|
|
|
|
2024-07-29 12:49:03 +00:00
|
|
|
/* cudaEGL.h */
|
|
|
|
#if defined(HAVE_CUDA_NVMM_JETSON) && GST_GL_HAVE_PLATFORM_EGL
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuGraphicsEGLRegisterImage (CUgraphicsResource * pCudaResource,
|
|
|
|
EGLImageKHR image, unsigned int Flags)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsEGLRegisterImage != nullptr);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsEGLRegisterImage (pCudaResource, image,
|
|
|
|
Flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuGraphicsResourceGetMappedEglFrame (CUeglFrame * eglFrame,
|
|
|
|
CUgraphicsResource resource, unsigned int index, unsigned int mipLevel)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsResourceGetMappedEglFrame != nullptr);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsResourceGetMappedEglFrame (eglFrame,
|
|
|
|
resource, index, mipLevel);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-02-28 10:24:31 +00:00
|
|
|
/* cudaD3D11.h */
|
2022-09-12 16:02:50 +00:00
|
|
|
#ifdef G_OS_WIN32
|
2022-02-28 10:24:31 +00:00
|
|
|
CUresult CUDAAPI
|
|
|
|
CuGraphicsD3D11RegisterResource (CUgraphicsResource * pCudaResource,
|
2022-09-12 16:02:50 +00:00
|
|
|
ID3D11Resource * pD3DResource, unsigned int Flags)
|
2022-02-28 10:24:31 +00:00
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsD3D11RegisterResource != nullptr);
|
2022-02-28 10:24:31 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsD3D11RegisterResource (pCudaResource,
|
|
|
|
pD3DResource, Flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
2022-09-12 16:02:50 +00:00
|
|
|
CuD3D11GetDevice (CUdevice * device, IDXGIAdapter * pAdapter)
|
2022-02-28 10:24:31 +00:00
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuD3D11GetDevice != nullptr);
|
2022-02-28 10:24:31 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuD3D11GetDevice (device, pAdapter);
|
|
|
|
}
|
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuD3D11GetDevices (unsigned int *pCudaDeviceCount,
|
2022-09-12 16:02:50 +00:00
|
|
|
CUdevice * pCudaDevices, unsigned int cudaDeviceCount,
|
|
|
|
ID3D11Device * pD3D11Device, CUd3d11DeviceList deviceList)
|
2022-02-28 10:24:31 +00:00
|
|
|
{
|
2023-02-05 10:50:36 +00:00
|
|
|
g_assert (gst_cuda_vtable.CuD3D11GetDevices != nullptr);
|
2022-02-28 10:24:31 +00:00
|
|
|
|
|
|
|
return gst_cuda_vtable.CuD3D11GetDevices (pCudaDeviceCount, pCudaDevices,
|
|
|
|
cudaDeviceCount, pD3D11Device, deviceList);
|
|
|
|
}
|
2021-12-08 11:48:08 +00:00
|
|
|
#endif
|