NVIDIA / NVIDIA/TensorRT

Issue with TensorRT inference run

Open
#4,181 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
13.4k
Forks
2.4k
Avg merge
5d 3h
Merged PRs (30d)
2

Description

void FeatureExtraction::doInference_run(float* inputBuffer, float* outputBuffer) {

cudaMemcpyAsync(buffers[inputIndex], inputBuffer, inputStreamSize * sizeof(float), cudaMemcpyHostToDevice, cudaStream);

// Ensure that tensor addresses are set
const char* inputTensorName = engine->getIOTensorName(inputIndex);
const char* outputTensorName = engine->getIOTensorName(outputIndex);

// Set tensor addresses
context->setTensorAddress(inputTensorName, buffers[inputIndex]);
context->setTensorAddress(outputTensorName, buffers[outputIndex]);

// Enqueue the inference
if (!context->enqueueV3(cudaStream)) {
    std::cerr << "Error: Inference run  failed!" << std::endl;
    return;
}
cudaMemcpyAsync(outputBuffer, buffers[outputIndex], outputStreamSize * sizeof(float), cudaMemcpyDeviceToHost, cudaStream);
cudaStreamSynchronize(cudaStream);

}

in this code after preprocessing the buffer data given to cuda for further action, But output Buffer has '0' data . What is the issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with FeatureExtraction::doInference_run and trace the input and output buffers through cudaMemcpyAsync, tensor address setup, enqueueV3, and cudaStreamSynchronize. Reproduce the inference with the reported code and determine why outputBuffer remains zero; done means the failure is identified and a verified nonzero or otherwise correct output is obtained.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.