Hello,
platform:Jetson Xavier with Jetpack 4.1.1
I means that I also met the problem about cudaMalloc failed when I run the inference, so that I want to know the factors which will cause cudaMalloc to fail, and are there any restrictions on calling this function ?
Thank for your reply.
the errors:
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0125 09:38:37.156844 10949 TensorRtCaffeModel.cpp:157] Check failed: cudaMalloc(&buffers[inputIndex], inputSize)
*** Check failure stack trace: ***
Aborted (core dumped)
the code:
void doInference(IExecutionContext& context, float* input, float* output0,int* output1, int batchSize)
{
const ICudaEngine& engine = context.getEngine();
// input and output buffer pointers that we pass to the engine
assert(engine.getNbBindings() == 3);
void* buffers[3];
/*data*/
int inputIndex = engine.getBindingIndex(INPUT_BLOB_NAME);
DimsCHW inputDims = static_cast<DimsCHW&&>(engine.getBindingDimensions(inputIndex));
size_t inputSize = batchSize * inputDims.c() * inputDims.h()*inputDims.w() * sizeof(float);
……
// allocate GPU buffers and a stream, inputSize = 3*1024*1024*4
CHECK(cudaMalloc(&buffers[inputIndex], inputSize));
CHECK(cudaMalloc(&buffers[outputIndex0], outputSize0 ));
CHECK(cudaMalloc(&buffers[outputIndex1], outputSize1 ));
……
}