DanaHan / Yolov5-in-Deepstream-5.0

Describe how to use yolov5 in Deepstream 5.0
209 stars 57 forks source link

Illegal seek (no space left on device) while building, but there is space on the device #36

Open mfoglio opened 11 months ago

mfoglio commented 11 months ago

Hello, I am trying to build the library within a docker container. Sometimes the build seems to work, sometimes it doesn't. More often than not, I get the following error:

g++ -c -o yoloPlugins.o -Wall -std=c++11 -shared -fPIC -Wno-error=deprecated-declarations -I../includes -I/usr/local/cuda-11.8/include yoloPlugins.cpp
In file included from yoloPlugins.cpp:23:
yoloPlugins.h:80:49: warning: 'IPluginV2' is deprecated [-Wdeprecated-declarations]
   80 |     nvinfer1::IPluginV2* clone() const noexcept override;
      |                                                 ^~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/NvInferLegacyDims.h:16,
                 from /usr/include/x86_64-linux-gnu/NvInfer.h:16,
                 from /usr/include/x86_64-linux-gnu/NvInferPlugin.h:16,
                 from yoloPlugins.h:32,
                 from yoloPlugins.cpp:23:
/usr/include/x86_64-linux-gnu/NvInferRuntimeCommon.h:393:22: note: declared here
  393 | class TRT_DEPRECATED IPluginV2
      |                      ^~~~~~~~~
In file included from yoloPlugins.cpp:23:
yoloPlugins.h:112:79: warning: 'IPluginV2' is deprecated [-Wdeprecated-declarations]
  112 |         const char* name, const nvinfer1::PluginFieldCollection* fc) noexcept override
      |                                                                               ^~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/NvInferLegacyDims.h:16,
                 from /usr/include/x86_64-linux-gnu/NvInfer.h:16,
                 from /usr/include/x86_64-linux-gnu/NvInferPlugin.h:16,
                 from yoloPlugins.h:32,
                 from yoloPlugins.cpp:23:
/usr/include/x86_64-linux-gnu/NvInferRuntimeCommon.h:393:22: note: declared here
  393 | class TRT_DEPRECATED IPluginV2
      |                      ^~~~~~~~~
In file included from yoloPlugins.cpp:23:
yoloPlugins.h:119:81: warning: 'IPluginV2' is deprecated [-Wdeprecated-declarations]
  119 |         const char* name, const void* serialData, size_t serialLength) noexcept override
      |                                                                                 ^~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/NvInferLegacyDims.h:16,
                 from /usr/include/x86_64-linux-gnu/NvInfer.h:16,
                 from /usr/include/x86_64-linux-gnu/NvInferPlugin.h:16,
                 from yoloPlugins.h:32,
                 from yoloPlugins.cpp:23:
/usr/include/x86_64-linux-gnu/NvInferRuntimeCommon.h:393:22: note: declared here
  393 | class TRT_DEPRECATED IPluginV2
      |                      ^~~~~~~~~
yoloPlugins.cpp:122:49: warning: 'IPluginV2' is deprecated [-Wdeprecated-declarations]
  122 | nvinfer1::IPluginV2* YoloLayerV3::clone() const noexcept
      |                                                 ^~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/NvInferLegacyDims.h:16,
                 from /usr/include/x86_64-linux-gnu/NvInfer.h:16,
                 from /usr/include/x86_64-linux-gnu/NvInferPlugin.h:16,
                 from yoloPlugins.h:32,
                 from yoloPlugins.cpp:23:
/usr/include/x86_64-linux-gnu/NvInferRuntimeCommon.h:393:22: note: declared here
  393 | class TRT_DEPRECATED IPluginV2
      |                      ^~~~~~~~~
/tmp/ccovsYPc.s: Assembler messages:
/tmp/ccovsYPc.s: Fatal error: can't write 285 bytes to section .text of yoloPlugins.o: 'Illegal seek'
/tmp/ccovsYPc.s: Fatal error: can't close yoloPlugins.o: No space left on device
make: *** [Makefile:51: yoloPlugins.o] Error 1

The message no space left on device seems to be obvious. However, there is space on the device, in fact, the output of df is:

Filesystem         1K-blocks     Used Available Use% Mounted on
overlay            236369912 58636644 165616000  27% /
tmpfs                  65536        0     65536   0% /dev
tmpfs               16391176        0  16391176   0% /sys/fs/cgroup
/dev/nvme0n1p6     236369912 58636644 165616000  27% /ai_data
tmpfs               16391176        4  16391172   1% /tmp/resin
shm                    65536        0     65536   0% /dev/shm
encrypted_storage: 236369912 70753912 165616000  30% /src/src

Is it possible that the error is caused by something else? I am not very familiar with C++: is there a way I can specify in the Makefile to use another folder in place of /tmp?

Thank you

EDIT: I tried to to set the environment variable TMPDIR to change the directory used by the Makefile. It does change the directory, but I still have the same error, fo instance /ai_data/tmp/ccfg6mpf.s: Fatal error: can't write 300 bytes to section .text of yolo.o: 'No space left on device'. I can guarantee the directory has space. I guess the root cause is something else and not space?

EDIT2: if I do this a libnvdsinfer_custom_impl_Yolo.so gets created after a few attempts, but it is empty.

while [ ! -f libnvdsinfer_custom_impl_Yolo.so ]
do
  make clean
  make
done