mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-04-07 18:05:51 +00:00
vcomp/cmpto_j2k: disable CUDA buffers with |GPU|>1
Disable copying to CUDA buffers if there is more CUDA devices configured, it does cause the following error: ``` [J2K enc.] Setting image samples: Cannot configure input samples in CUDA buffer because argument 'device_id' doesn't match the configured CUDA device in encoder. Single CUDA encoder must be configured. ```
This commit is contained in:
@@ -44,8 +44,7 @@
|
|||||||
* the GPU encoder.
|
* the GPU encoder.
|
||||||
*
|
*
|
||||||
* @todo
|
* @todo
|
||||||
* - check multiple CUDA devices - now the data are always copied to
|
* - check support for multiple CUDA devices with CUDA buffers
|
||||||
* the first CUDA device
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
@@ -220,13 +219,17 @@ static bool configure_with(struct state_video_compress_j2k *s, struct video_desc
|
|||||||
|
|
||||||
s->pool_in_device_memory = false;
|
s->pool_in_device_memory = false;
|
||||||
#ifdef HAVE_CUDA
|
#ifdef HAVE_CUDA
|
||||||
if (s->convertFunc == nullptr) {
|
if (s->convertFunc == nullptr && cuda_devices_count == 1) {
|
||||||
s->pool_in_device_memory = true;
|
s->pool_in_device_memory = true;
|
||||||
s->pool = video_frame_pool(
|
s->pool = video_frame_pool(
|
||||||
s->max_in_frames,
|
s->max_in_frames,
|
||||||
cmpto_j2k_enc_cuda_buffer_data_allocator<
|
cmpto_j2k_enc_cuda_buffer_data_allocator<
|
||||||
cuda_wrapper_malloc, cuda_wrapper_free>());
|
cuda_wrapper_malloc, cuda_wrapper_free>());
|
||||||
} else {
|
} else {
|
||||||
|
if (cuda_devices_count > 1) {
|
||||||
|
MSG(WARNING, "More than 1 CUDA device will use CPU "
|
||||||
|
"buffers. Please report...\n");
|
||||||
|
}
|
||||||
s->pool = video_frame_pool(
|
s->pool = video_frame_pool(
|
||||||
s->max_in_frames,
|
s->max_in_frames,
|
||||||
cmpto_j2k_enc_cuda_buffer_data_allocator<
|
cmpto_j2k_enc_cuda_buffer_data_allocator<
|
||||||
@@ -438,10 +441,6 @@ static struct module * j2k_compress_init(struct module *parent, const char *c_cf
|
|||||||
CHECK_OK(cmpto_j2k_enc_ctx_cfg_add_cuda_device(ctx_cfg, cuda_devices[i], mem_limit, tile_limit),
|
CHECK_OK(cmpto_j2k_enc_ctx_cfg_add_cuda_device(ctx_cfg, cuda_devices[i], mem_limit, tile_limit),
|
||||||
"Setting CUDA device", goto error);
|
"Setting CUDA device", goto error);
|
||||||
}
|
}
|
||||||
if (cuda_devices_count > 1) {
|
|
||||||
MSG(WARNING, "More than one CUDA device is not tested and may "
|
|
||||||
"not work. Please report...\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
CHECK_OK(cmpto_j2k_enc_ctx_create(ctx_cfg, &s->context), "Context create",
|
CHECK_OK(cmpto_j2k_enc_ctx_create(ctx_cfg, &s->context), "Context create",
|
||||||
goto error);
|
goto error);
|
||||||
|
|||||||
Reference in New Issue
Block a user