Skip to content

nvinfer1::ICudaEngine failure of TensorRT 10.4 when running Ubuntu 22.04 on GPU A2000 #4133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ahmet-f-gumustas opened this issue Sep 18, 2024 · 4 comments
Labels
triaged Issue has been triaged by maintainers

Comments

@ahmet-f-gumustas
Copy link

Environment

TensorRT Version: 10.4

NVIDIA GPU: A2000

NVIDIA Driver Version: 560

CUDA Version: Cuda 12.6

CUDNN Version: 9.4

Operating System: Ubuntu 22.04

Python Version (if applicable):

Tensorflow Version (if applicable):

PyTorch Version (if applicable):

Baremetal or Container (if so, version):

This is my Code ;

for (int i = 0; i < engine->getNbBindings(); i++) {  // getNbBindings() ile binding sayısı alınıyor
    if (engine->bindingIsInput(i)) {  // bindingIsInput ile input olup olmadığı kontrol ediliyor
        inputIndex = i;
        std::cout << "Found input binding at index " << i << std::endl;
    } else {
        outputIndex = i;
        std::cout << "Found output binding at index " << i << std::endl;
    }
}

if (inputIndex == -1 || outputIndex == -1) {
    std::cerr << "Failed to find input or output bindings!" << std::endl;
    return -1;
}

// Get the dimensions of input/output
nvinfer1::Dims inputDims = engine->getBindingDimensions(inputIndex);
nvinfer1::Dims outputDims = engine->getBindingDimensions(outputIndex);

And gave me an vs code error : "class "nvinfer1::ICudaEngine" has no member "getNbBindings"C/C++(135)"

Terminal Output:

ahmet@ahmet-Precision-3660:~/workspace-example/tensorrt$ g++ 02-running-engine-file.cpp -o engine-result -I/usr/local/cuda/include -L/usr/local/cuda/lib64 -lnvinfer -lcudart -std=c++11
02-running-engine-file.cpp: In function ‘int main()’:
02-running-engine-file.cpp:60:33: error: ‘class nvinfer1::ICudaEngine’ has no member named ‘getNbBindings’
60 | for (int i = 0; i < engine->getNbBindings(); i++) { // getNbBindings() ile binding sayısı alınıyor
| ^~~~~~~~~~~~~
02-running-engine-file.cpp:61:21: error: ‘class nvinfer1::ICudaEngine’ has no member named ‘bindingIsInput’
61 | if (engine->bindingIsInput(i)) { // bindingIsInput ile input olup olmadığı kontrol ediliyor
| ^~~~~~~~~~~~~~
02-running-engine-file.cpp:76:40: error: ‘class nvinfer1::ICudaEngine’ has no member named ‘getBindingDimensions’
76 | nvinfer1::Dims inputDims = engine->getBindingDimensions(inputIndex);
| ^~~~~~~~~~~~~~~~~~~~
02-running-engine-file.cpp:77:41: error: ‘class nvinfer1::ICudaEngine’ has no member named ‘getBindingDimensions’
77 | nvinfer1::Dims outputDims = engine->getBindingDimensions(outputIndex);
| ^~~~~~~~~~~~~~~~~~~~

How to solve this :(

@lix19937
Copy link

And gave me an vs code error : "class "nvinfer1::ICudaEngine" has no member "getNbBindings"C/C++(135)"

Please use ICudaEngine::getNbIOTensors(). @ahmet-f-gumustas

@moraxu moraxu added API: C++ triaged Issue has been triaged by maintainers labels Sep 20, 2024
@ahmet-f-gumustas
Copy link
Author

Thank You I solved .

@mehmetkurt20
Copy link

What can be used for getBindingIndex and getBindingDimensions, same errors exist with you have when I try to use those from ICudaEngine class.

@santiweide
Copy link

Maybe try Dims getDimensions(char const* inputName, OptProfileSelector select) const noexcept?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issue has been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

5 participants