FeiYull / TensorRT-Alpha

🔥🔥🔥TensorRT for YOLOv8、YOLOv8-Pose、YOLOv8-Seg、YOLOv8-Cls、YOLOv7、YOLOv6、YOLOv5、YOLONAS......🚀🚀🚀CUDA IS ALL YOU NEED.🍎🍎🍎
GNU General Public License v2.0
1.28k stars 198 forks source link

我有两张显卡,设置为gpu_id = 1 推理异常 #28

Closed zouwen198317 closed 1 year ago

zouwen198317 commented 1 year ago

bool YOLOV8::init(const std::vector& trtFile,int gpu_id =0) { // 1. init engine & context if (trtFile.empty()) { return false; }

this->set_gpu(gpu_id);

cudaError_t cudaError = cudaSetDevice(gpu_id);
if (cudaError == cudaSuccess)
{
    std::cout << "GPU device selected successfully!" << std::endl;
}
else
{
    std::cout << "GPU device selection failed!" << std::endl;
    return false;
}

///========================= [04/15/2023-23:32:04] [E] [TRT] 1: [convolutionRunner.cpp::nvinfer1::rt::task::CaskConvolutionRunner::execute::213] Error Code 1: Cask (Cask convolution execution) [04/15/2023-23:32:04] [E] [TRT] 1: [checkMacros.cpp::nvinfer1::catchCudaError::278] Error Code 1: Cuda Runtime (an illegal memory access was encountered)

zouwen198317 commented 1 year ago

已经解决,cuda空间申请不单init里面有, 构造函数里面也有,统一就好

jiamfeng commented 7 months ago

怎么设置的呀,我也遇到了这个问题 @zouwen198317