Giter VIP home page Giter VIP logo

TX2 运行时报错,锁业内存:terminate called after throwing an instance of 'thrust::system::system_error' what(): radix_sort: failed on 2nd step: cudaErrorHostMemoryNotRegistered: pointer does not correspond to a registered memory region Aborted (core dumped) about tensorrt-alpha HOT 3 CLOSED

lyb36524 avatar lyb36524 commented on May 10, 2024
TX2 运行时报错,锁业内存:terminate called after throwing an instance of 'thrust::system::system_error' what(): radix_sort: failed on 2nd step: cudaErrorHostMemoryNotRegistered: pointer does not correspond to a registered memory region Aborted (core dumped)

from tensorrt-alpha.

Comments (3)

FeiYull avatar FeiYull commented on May 10, 2024

@lyb36524
If the code is running in the TX2 device, please modify the code(

void yolo::YOLO::copy(const std::vector<cv::Mat>& imgsBatch)
): Set line 152 to 0, line 165 set to 1, as shown in the following code:
//-------------------------------------------------------------------------------------------------------------
void yolo::YOLO::copy(const std::vectorcv::Mat& imgsBatch)
{
#if 0
cv::Mat img_fp32 = cv::Mat::zeros(imgsBatch[0].size(), CV_32FC3); // todo
cudaHostRegister(img_fp32.data, img_fp32.elemSize() * img_fp32.total(), cudaHostRegisterPortable);
float* pi = m_input_src_device;
for (size_t i = 0; i < imgsBatch.size(); i++)
{
imgsBatch[i].convertTo(img_fp32, CV_32FC3);
checkRuntime(cudaMemcpy(pi, img_fp32.data, sizeof(float) * 3 * m_param.src_h * m_param.src_w, cudaMemcpyHostToDevice));
pi += 3 * m_param.src_h * m_param.src_w;
}
cudaHostUnregister(img_fp32.data);
#endif

#if 1 // for Nvidia TX2
cv::Mat img_fp32 = cv::Mat::zeros(imgsBatch[0].size(), CV_32FC3); // todo
float* pi = m_input_src_device;
for (size_t i = 0; i < imgsBatch.size(); i++)
{
std::vector img_vec = std::vector(imgsBatch[i].reshape(1, 1));
imgsBatch[i].convertTo(img_fp32, CV_32FC3);
checkRuntime(cudaMemcpy(pi, img_fp32.data, sizeof(float) * 3 * m_param.src_h * m_param.src_w, cudaMemcpyHostToDevice));
pi += 3 * m_param.src_h * m_param.src_w;
}
#endif
}

from tensorrt-alpha.

FeiYull avatar FeiYull commented on May 10, 2024

from tensorrt-alpha.

FeiYull avatar FeiYull commented on May 10, 2024

This part of the code has been modified to be compatible with TX2.

// update 20230302, faster.

from tensorrt-alpha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.