For running trtexec to generate tensorrt engine, I can generate the int8 engine successfully on one A40 machine. My command and logs are as below. You can refer to my command to use --workspace=10000000 to double check.
$ yolo_v4 gen_trt_engine -m yolo-TAO3-QAT-Export-TAO5/etlt-to-onnx/yolov4_cspdarknet19_epoch_240.onnx \
-e ./spec.txt --data_type int8 -r result \
--batch_size 1 --min_batch_size 1 --opt_batch_size 1 --max_batch_size 1 \
--cal_json_file /localhome/local-morganh/forum_350314_yolov4/customer_data/cal_morgan.json \
--engine_file trt.morgan.int8 \
--cal_data_file /localhome/local-morganh/forum_350314_yolov4/customer_data/cal_morgan.tensorfile \
--cal_image_dir /localhome/local-morganh/forum_350314_yolov4/customer_data/sample_inputs_copy \
--cal_cache_file /localhome/local-morganh/forum_350314_yolov4/customer_data/cal_morgan.cache
$ /usr/src/tensorrt/bin/trtexec \
--onnx=yolo-TAO3-QAT-Export-TAO5/etlt-to-onnx/yolov4_cspdarknet19_epoch_240.onnx \
--saveEngine=/localhome/local-morganh/forum_350314_yolov4/customer_data/trt.morgan.int8.trtexec \
--minShapes=Input:1x3x832x4096 \
--optShapes=Input:1x3x832x4096 \
--maxShapes=Input:1x3x832x4096 \
--int8 \
--calib=/localhome/local-morganh/forum_350314_yolov4/customer_data/cal_morgan.cache \
--workspace=10000000
20251201_forum_350314_run_trtexec_generate_engine.txt (42.6 KB)
Then, please use trtexec to generate engine. Or you can directly deploy onnx file and cal.bin file to deepstream apps and let it generate tensorrt engine. The example config file can be found in deepstream_tao_apps/deepstream_app_tao_configs/nvinfer/config_infer_primary_yolov4.txt at release/tao_ds7.1ga · NVIDIA-AI-IOT/deepstream_tao_apps · GitHub.