vdec/cmpto_j2k: don't use GPU postp. with more dev

If multiple CUDA devices are used, do not use the CUDA postprocess,
because this is not supported by the codec (at least the version
2.5.8). Error:
```
[J2K dec.] Error initializing context: CUDA postprocessor is supported
only when single CUDA device is configured
```
This commit is contained in:
Martin Pulec
2024-09-03 11:08:28 +02:00
parent b1ff4c6d29
commit e37e58cf52

View File

@@ -295,16 +295,20 @@ set_postprocess_convert(struct state_decompress_j2k *s,
const struct conv_props *codec)
{
if (codec->run_callback != nullptr) {
CHECK_OK(cmpto_j2k_dec_ctx_cfg_set_postprocessor_cuda(
ctx_cfg, nullptr, nullptr, codec->size_callback,
codec->run_callback),
"add postprocessor", return false);
} else {
s->convert = codec->convert;
if (s->convert != nullptr) {
MSG(WARNING, "Compiled without CUDA, pixfmt conv will "
"be processed on CPU...\n");
if (cuda_devices_count == 1) {
CHECK_OK(cmpto_j2k_dec_ctx_cfg_set_postprocessor_cuda(
ctx_cfg, nullptr, nullptr,
codec->size_callback, codec->run_callback),
"add postprocessor", return false);
return true;
}
MSG(WARNING,
"More than 1 CUDA device set, will use CPU conversion...\n");
}
s->convert = codec->convert;
if (s->convert != nullptr && codec->run_callback == nullptr) {
MSG(WARNING, "Compiled without CUDA, pixfmt conv will "
"be processed on CPU...\n");
}
return true;
}