mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
nvcodec: Peer direct access support
If support direct access each other, use device to device memory copy without staging host memory Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1633>
This commit is contained in:
parent
d16a9237c3
commit
b1ac8bafc9
2 changed files with 8 additions and 4 deletions
|
@ -2450,10 +2450,12 @@ gst_nv_base_enc_handle_frame (GstVideoEncoder * enc, GstVideoCodecFrame * frame)
|
|||
gst_is_cuda_memory (mem)) {
|
||||
GstCudaMemory *cmem = GST_CUDA_MEMORY_CAST (mem);
|
||||
|
||||
/* FIXME: enhance CUDA memory copy over multiple-gpu */
|
||||
if (cmem->context == nvenc->cuda_ctx ||
|
||||
gst_cuda_context_get_handle (cmem->context) ==
|
||||
gst_cuda_context_get_handle (nvenc->cuda_ctx)) {
|
||||
gst_cuda_context_get_handle (nvenc->cuda_ctx) ||
|
||||
(gst_cuda_context_can_access_peer (cmem->context, nvenc->cuda_ctx) &&
|
||||
gst_cuda_context_can_access_peer (nvenc->cuda_ctx,
|
||||
cmem->context))) {
|
||||
use_device_memory = TRUE;
|
||||
in_map_flags |= GST_MAP_CUDA;
|
||||
}
|
||||
|
|
|
@ -1151,10 +1151,12 @@ gst_nvdec_copy_device_to_memory (GstNvDec * nvdec,
|
|||
gst_is_cuda_memory (mem)) {
|
||||
GstCudaMemory *cmem = GST_CUDA_MEMORY_CAST (mem);
|
||||
|
||||
/* FIXME: enhance CUDA memory copy over multiple-gpu */
|
||||
if (cmem->context == nvdec->cuda_ctx ||
|
||||
gst_cuda_context_get_handle (cmem->context) ==
|
||||
gst_cuda_context_get_handle (nvdec->cuda_ctx)) {
|
||||
gst_cuda_context_get_handle (nvdec->cuda_ctx) ||
|
||||
(gst_cuda_context_can_access_peer (cmem->context, nvdec->cuda_ctx) &&
|
||||
gst_cuda_context_can_access_peer (nvdec->cuda_ctx,
|
||||
cmem->context))) {
|
||||
cuda_mem = cmem;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue