Environment variables#
Environment variables that can be set to control some global settings of the NVIDIA® nvImageCodec library.
NVIMGCODEC_DEFAULT_NUM_CUDA_STREAMS#
Number of CUDA streams used by the generic decoder and encoder when no explicit value is set via the options string (e.g. :num_cuda_streams=4). If set, must be a positive integer not greater than the number of worker threads. If unset, the default equals the number of worker threads.
NVIMGCODEC_MAX_IMAGE_SIZE#
If specified, it imposes a maximum image volume size (in bytes). This setting is used to prevent malicious attacks where an encoded image can be crafted to represent large image dimensions that will cause an OOM error. If the maximum volume in bytes (height * width * num_channels * data_type_size) exceeds this value, an explicit error will be triggered before attempting an allocation.
NVIMGCODEC_MAX_JPEG_SCANS#
Maximum allowed number of progressive JPEG scans. Default value is 256. This limit is set to prevent a denial-of-service vulnerability via a crafted JPEG (see https://cure53.de/pentest-report_libjpeg-turbo.pdf)
PYNVIMGCODEC_VERBOSITY#
Level of logging, when using the Python API. Possible values are
1: Error 2: Warning 3: Info 4: Debug 5: Trace (only debug builds)