Getting Started#
Before getting started, review the prerequisites. Then pick your path:
Which algorithm? See Algorithm Selection for a comparison of all supported compressors.
Which API? See API Comparison to choose between the Python, C++, C, and nvCOMPDx interfaces.
Ready to code? Jump to the samples below.
Note
Throughout this document, the terms “CPU” and “Host” are used synonymously. Similarly, the terms “GPU” and “Device” are synonymous.
Thread Safety#
Not all nvCOMP types are thread-safe.
Logging#
- To enable logging, set the
NVCOMP_LOG_LEVELenvironment variable to an integer: 0 for no logging
1 for only error messages
2 for errors and trace messages
3 for errors, traces and hint messages
4 for errors, traces, hints and information messages
5 for errors, traces, hints, information and API call messages logged for every low-level interface API
6 for errors, traces, hints, information and API call and debug messages
By default, log messages will be written to stdout. If the
NVCOMP_LOG_FILE environment variable is set to a valid file path,
messages will be logged to that file. At present, logging functionality
is only limited to errors and API calls.
Samples#
The next section documents the samples showing various use cases across two different types of APIs available to consume nvCOMP functionality:
- C API samples
- C++ API samples
- Python API samples
- Basics
- Import nvComp python module and check versions
- Zero-copy import host array
- Zero-copy import device array
- Convert host array to device array
- Convert device array to host array
- Encode single array
- Decode single array
- Codec specific options
- Encode single array with multiple codecs
- Decoding single arrays of various formats
- Encoding and decoding with various Bitstream Kinds
- Batch encoding
- Batch decoding
- Batch decoding and encoding various formats
- Checksum example
- Pre-configure API
- Pre-allocated output buffers
- Basics
Refer to the Installation page for installation instructions. To compile our samples from source, consult our GitHub Samples page for instructions.