Hey there,
when using VPI, we stumbled get the following error:
terminate called after throwing an instance of 'std::runtime_error' what(): [VPI ERROR]VPI_ERROR_INTERNAL | Failed to create an NvMediaVPI handle
The exception is thrown by a wrapper for VPI function calls like this, which also generates the message above. It basically pretty prints VPI error statuses and throws.
void check_vpi(const VPIStatus &vpi_status, const std::string &message) {
if (vpi_status != VPI_SUCCESS) {
char buffer[VPI_MAX_STATUS_MESSAGE_LENGTH];
vpiGetLastStatusMessage(buffer, sizeof(buffer));
std::ostringstream ss;
ss << "[VPI ERROR]" << vpiStatusGetName(vpi_status) << " | " << buffer << ": " << message;
throw std::runtime_error(ss.str());
}
}
This would be an example usage:
check_vpi(vpiImageCreateCUDAMemWrapper(...));
This happens when repeatedly launching our executable. It even happens when there is a minute long pause between launches.
So the sequence is:
- Launch executable
- Wait for it to finish running
- Optionally wait
- Repeat
Is there any remedy for this? We did not yet pinpoint the location of the exception, since it is not directly reproducible. It only happens sometimes. I would assume that it does not have to do with the wrapped call per se, but simply fails on the first call because there is no VPI handle.