Skip to content

使用TRT运行seg出现std::bad_alloc #567

Description

@Synmul

std::string shape_info_path = "./trt_shape.txt";
if (!PathExists(shape_info_path)) {
infer_config.CollectShapeRangeInfo(shape_info_path);//<<<<<<<<<<<<<<<<<<<<<<这行出现std::bad_alloc,如果不用TRT就跑不到这行,后面都可以正常运行。
}
else {
infer_config.EnableTunedTensorRtDynamicShape(shape_info_path, true);
}

paddle_inference.dll是从官方下载的
https://paddle-inference-lib.bj.bcebos.com/2.3.2/cxx_c/Windows/GPU/x86-64_cuda11.6_cudnn8.4.0_trt8.4.1.5_mkl_avx_vs2019/paddle_inference.zip
之前也是这台电脑用的Ubuntu系统没这个问题,现在换成win10出现了这个毛病。
在运行之前是有12G空闲内存的
模型用的是human_pp_humansegv1_lite_192x192_inference_model
https://paddleseg.bj.bcebos.com/dygraph/pp_humanseg_v2/human_pp_humansegv1_lite_192x192_inference_model.zip
GIT COMMIT ID: 4596b9a22540fb0ea5d369c3c804544de61d03d0
WITH_MKL: ON
WITH_MKLDNN: ON
WITH_GPU: ON
WITH_ROCM: OFF
WITH_ASCEND_CL: OFF
WITH_ASCEND_CXX11: OFF
WITH_IPU: OFF
CUDA version: 11.6
CUDNN version: v8.4
CXX compiler version: 19.29.30145.0
WITH_TENSORRT: ON
TensorRT version: v8.4.1.5

paddle_inference.dll的基址0x00007FFFB2170000
0x00007FF8F8195369 处(位于 demo.exe 中)有未经处理的异常: Microsoft C++ 异常: std::bad_alloc,位于内存位置 0x0000004AF9BBE620 处。

KernelBase.dll!RaiseException()	未知

paddle_inference.dll!00007fffb5ae4274() 未知
paddle_inference.dll!00007fffb280ab5f() 未知
paddle_inference.dll!00007fffb5ae287d() 未知
paddle_inference.dll!00007fffb24fbd92() 未知
paddle_inference.dll!00007fffb5a3374e() 未知

KernelBase.dll!00007ff8f8195369() 未知
00007FF8F81952FF int 3
00007FF8F8195300 sub rsp,0D8h
00007FF8F8195307 mov rax,qword ptr [__security_cookie (07FF8F8425EA0h)]
00007FF8F819530E xor rax,rsp
00007FF8F8195311 mov qword ptr [rsp+0C0h],rax
00007FF8F8195319 and qword ptr [rsp+28h],0
00007FF8F819531F lea rax,[RaiseException (07FF8F8195300h)]
00007FF8F8195326 and edx,1
00007FF8F8195329 mov dword ptr [rsp+20h],ecx
00007FF8F819532D mov dword ptr [rsp+24h],edx
00007FF8F8195331 mov qword ptr [rsp+30h],rax
00007FF8F8195336 test r9,r9
00007FF8F8195339 je RaiseException+87h (07FF8F8195387h)
00007FF8F819533B mov eax,0Fh
00007FF8F8195340 lea rcx,[rsp+40h]
00007FF8F8195345 cmp r8d,eax
00007FF8F8195348 mov rdx,r9
00007FF8F819534B cmova r8d,eax
00007FF8F819534F mov dword ptr [rsp+38h],r8d
00007FF8F8195354 shl r8,3
00007FF8F8195358 call memcpy (07FF8F8226D17h)
00007FF8F819535D lea rcx,[rsp+20h]
00007FF8F8195362 call qword ptr [__imp_RtlRaiseException (07FF8F83532D8h)]
00007FF8F8195369 nop dword ptr [rax+rax]
00007FF8F819536E mov rcx,qword ptr [rsp+0C0h]
00007FF8F8195376 xor rcx,rsp
00007FF8F8195379 call __security_check_cookie (07FF8F81FED40h)
00007FF8F819537E add rsp,0D8h
00007FF8F8195385 ret
00007FF8F8195386 int 3
00007FF8F8195387 and dword ptr [rsp+38h],0
00007FF8F819538C jmp RaiseException+5Dh (07FF8F819535Dh)
00007FF8F819538E int 3
paddle_inference.dll!00007fffb5ae4274() 未知
00007FFFB5AE41E3 int 3
00007FFFB5AE41E4 mov qword ptr [rsp+18h],rbx
00007FFFB5AE41E9 mov qword ptr [rsp+20h],rsi
00007FFFB5AE41EE push rdi
00007FFFB5AE41EF sub rsp,50h
00007FFFB5AE41F3 mov rbx,rdx
00007FFFB5AE41F6 mov rsi,rcx
00007FFFB5AE41F9 mov edi,19930520h
00007FFFB5AE41FE test rdx,rdx
00007FFFB5AE4201 je 00007FFFB5AE4220
00007FFFB5AE4203 test byte ptr [rdx],10h
00007FFFB5AE4206 je 00007FFFB5AE4220
00007FFFB5AE4208 mov rcx,qword ptr [rcx]
00007FFFB5AE420B sub rcx,8
00007FFFB5AE420F mov rax,qword ptr [rcx]
00007FFFB5AE4212 mov rbx,qword ptr [rax+30h]
00007FFFB5AE4216 mov rax,qword ptr [rax+40h]
00007FFFB5AE421A call qword ptr [7FFFB5FC0778h]
00007FFFB5AE4220 lea rdx,[rsp+20h]
00007FFFB5AE4225 mov rcx,rbx
00007FFFB5AE4228 call qword ptr [7FFFB5FC0450h]
00007FFFB5AE422E mov qword ptr [rsp+20h],rax
00007FFFB5AE4233 test rbx,rbx
00007FFFB5AE4236 je 00007FFFB5AE4247
00007FFFB5AE4238 test byte ptr [rbx],8
00007FFFB5AE423B jne 00007FFFB5AE4242
00007FFFB5AE423D test rax,rax
00007FFFB5AE4240 jne 00007FFFB5AE4247
00007FFFB5AE4242 mov edi,1994000h
00007FFFB5AE4247 mov edx,1
00007FFFB5AE424C mov qword ptr [rsp+28h],rdi
00007FFFB5AE4251 lea r9,[rsp+28h]
00007FFFB5AE4256 mov qword ptr [rsp+30h],rsi
00007FFFB5AE425B mov ecx,0E06D7363h
00007FFFB5AE4260 mov qword ptr [rsp+38h],rbx
00007FFFB5AE4265 mov qword ptr [rsp+40h],rax
00007FFFB5AE426A lea r8d,[rdx+3]
00007FFFB5AE426E call qword ptr [7FFFB5FC0458h]
00007FFFB5AE4274 mov rbx,qword ptr [rsp+70h] <<<<<<<<<<<<<<<<<<<<<<<
00007FFFB5AE4279 mov rsi,qword ptr [rsp+78h]
00007FFFB5AE427E add rsp,50h
00007FFFB5AE4282 pop rdi
00007FFFB5AE4283 ret
00007FFFB5AE4284 mov rax,rsp
00007FFFB5AE4287 mov qword ptr [rax+20h],r9
00007FFFB5AE428B mov qword ptr [rax+18h],r8
00007FFFB5AE428F mov qword ptr [rax+10h],rdx
00007FFFB5AE4293 mov qword ptr [rax+8],rcx
00007FFFB5AE4297 push rbx
00007FFFB5AE4298 sub rsp,70h
00007FFFB5AE429C mov rbx,rcx
00007FFFB5AE429F and dword ptr [rax-38h],0
00007FFFB5AE42A3 mov qword ptr [rax-20h],rcx
00007FFFB5AE42A7 mov qword ptr [rax-18h],r8
00007FFFB5AE42AB call 00007FFFB5AE69DC
00007FFFB5AE42B0 lea rdx,[rsp+58h]
00007FFFB5AE42B5 mov ecx,dword ptr [rbx]
00007FFFB5AE42B7 mov rax,qword ptr [rax+10h]
00007FFFB5AE42BB call qword ptr [7FFFB5FC0778h]
00007FFFB5AE42C1 mov dword ptr [rsp+40h],0
00007FFFB5AE42C9 jmp 00007FFFB5AE42CB
00007FFFB5AE42CB mov eax,dword ptr [rsp+40h]
00007FFFB5AE42CF add rsp,70h
00007FFFB5AE42D3 pop rbx
00007FFFB5AE42D4 ret
00007FFFB5AE42D5 int 3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions