NVIDIA-AI-IOT / jetbot

An educational AI robot based on NVIDIA Jetson Nano.
MIT License
2.97k stars 1.02k forks source link

object_following/live_demo.ipynb does not close nvargus CaptureSession, disabling creating CaptureSession for the 2nd time #1

Closed tokk-nv closed 1 year ago

tokk-nv commented 5 years ago

object_following/live_demo.ipynb often runs into a state where you cannot re-open camera unless you restart nvargus_daemon.

`journalctl' shows the following error.

Mar 13 14:47:08 jetbot sh[3626]: [I 14:47:08.986 LabApp] Kernel shutdown: 8aba3827-531e-4440-bd05-ce4b4819e05d
Mar 13 14:47:09 jetbot sh[3626]: [W 14:47:09.035 LabApp] Got events for closed stream None
Mar 13 14:47:09 jetbot sh[3626]: [I 14:47:09.067 LabApp] Saving file at /Notebooks/object_following/live_demo.ipynb
Mar 13 14:47:09 jetbot nvargus-daemon[26778]: === python3[26820]: Connection closed (7FA1F661D0)=== python3[26820]: WARNING: CameraProvider was not destroyed before client connection terminated.=== python3[26820]:          The client may have abnormally terminated. Destroying CameraProvider...=== python3[26820]: CameraProvider destroyed (0x7f9c810030)=== python3[26820]: WARNING: Cleaning up 1 outstanding requests...=== python3[26820]: WARNING: Cleaning up 1 outstanding streams...SCF: Error Timeout:  (propagating from src/services/gl/EGLStreamProducer.cpp, function getBuffer(), line 349)
Mar 13 14:47:09 jetbot nvargus-daemon[26778]: (NvCameraUtils) Error InvalidState: Mutex has not been initialized (in Mutex.cpp, function unlock(), line 88)
Mar 13 14:47:09 jetbot nvargus-daemon[26778]: SCF: Error Timeout:  (propagating from src/components/CaptureContainerImpl.cpp, function assignAllBuffersFromStream(), line 230)
Mar 13 14:47:09 jetbot nvargus-daemon[26778]: SCF: Error Timeout:  (propagating from src/components/stages/CCDataSetupStage.cpp, function doHandleRequest(), line 68)
Mar 13 14:47:09 jetbot nvargus-daemon[26778]: SCF: Error Timeout:  (propagating from src/components/stages/OrderedStage.cpp, function doExecute(), line 158)
Mar 13 14:47:09 jetbot nvargus-daemon[26778]: SCF: Error Timeout: Sending critical error event (in src/api/Session.cpp, function sendErrorEvent(), line 990)
Mar 13 14:47:10 jetbot nvargus-daemon[26778]: === python3[26820]: WARNING: Cleaning up 1 outstanding stream settings...=== python3[26820]: WARNING: Cleaning up 1 outstanding sessions...(Argus) Error InvalidState: EGLStream not connected (in src/api/PendingRequest.cpp, function fillSCFCaptureRequest(), line 159)
Mar 13 14:47:10 jetbot nvargus-daemon[26778]: (Argus) Error InvalidState:  (propagating from src/api/ScfCaptureThread.cpp, function run(), line 104)
Mar 13 14:47:15 jetbot nvargus-daemon[26778]: waitForIdleLocked remaining request 1587
Mar 13 14:47:15 jetbot nvargus-daemon[26778]: waitForIdleLocked remaining request 1586
Mar 13 14:47:15 jetbot nvargus-daemon[26778]: waitForIdleLocked remaining request 1585
Mar 13 14:47:15 jetbot nvargus-daemon[26778]: SCF: Error Timeout: waitForIdle() timed out (in src/api/Session.cpp, function waitForIdleLocked(), line 920)
Mar 13 14:47:15 jetbot nvargus-daemon[26778]: (Argus) Error Timeout:  (propagating from src/api/CaptureSessionImpl.cpp, function destroy(), line 166)
Mar 13 14:47:15 jetbot sh[3626]: [I 14:47:15.450 LabApp] Kernel started: d2864186-4666-47f6-af34-6967dca77bc7
Mar 13 14:47:19 jetbot sh[3626]: [I 14:47:19.022 LabApp] Adapting to protocol v5.1 for kernel d2864186-4666-47f6-af34-6967dca77bc7
Mar 13 14:47:20 jetbot nvargus-daemon[26778]: waitForIdleLocked remaining request 1587
Mar 13 14:47:20 jetbot nvargus-daemon[26778]: waitForIdleLocked remaining request 1586
Mar 13 14:47:20 jetbot nvargus-daemon[26778]: waitForIdleLocked remaining request 1585
Mar 13 14:47:20 jetbot nvargus-daemon[26778]: SCF: Error Timeout: waitForIdle() timed out (in src/api/Session.cpp, function waitForIdleLocked(), line 920)
Mar 13 14:47:20 jetbot nvargus-daemon[26778]: SCF: Error Timeout:  (propagating from src/api/Session.cpp, function abortCaptures(), line 886)
Mar 13 14:47:20 jetbot nvargus-daemon[26778]: SCF: Error Timeout:  (propagating from src/api/Session.cpp, function shutdown(), line 400)
Mar 13 14:47:20 jetbot nvargus-daemon[26778]: PowerServiceCore:handleRequests: timePassed = 5102
Mar 13 14:47:20 jetbot nvargus-daemon[26778]: SCF: Error Timeout:  (propagating from src/api/Session.cpp, function shutdown(), line 500)

Mar 13 14:47:20 jetbot nvargus-daemon[26778]: SCF: Error Timeout:  (propagating from src/api/CameraDriver.cpp, function deleteSession(), line 619)
Mar 13 14:47:20 jetbot nvargus-daemon[26778]: (Argus) Error Timeout:  (propagating from src/api/CaptureSessionImpl.cpp, function destroy(), line 191)

Mar 13 14:47:46 jetbot NetworkManager[3797]: <info>  [1552513666.4149] connectivity: (l4tbr0) timed out
Mar 13 14:48:09 jetbot nvargus-daemon[26778]: === python3[26820]: NOTE: Destroy all libargus objects before destroying the CameraProvider to avoid these warnings.=== python3[26820]: Connection cleaned up (7FA1F661D0)=== python3[27938]: Connection established (7FA1F661D0)=== python3[27938]: CameraProvider initialized (0x7f9c810470)(Argus) Error InvalidState: CaptureProvider destroyed (in src/api/CameraProviderImpl.cpp, function createCaptureSession(), line 205)
Mar 13 14:48:09 jetbot sh[3626]: Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:532 Failed to create CaptureSession
Mar 13 14:48:25 jetbot nvargus-daemon[26778]: === python3[27938]: Connection closed (7FA1F661D0)=== python3[27938]: WARNING: CameraProvider was not destroyed before client connection terminated.=== python3[27938]:          The client may have abnormally terminated. Destroying CameraProvider...=== python3[27938]: CameraProvider destroyed (0x7f9c810470)(Argus) Error InvalidState: Object was already destroyed (in src/common/ObjectImpl.cpp, function destroyClientReference(), line 47)

You can execute the cell #5 of collision_avoidance/live_demo.ipynb many times followed after kernel shutdown.

jaybdub commented 5 years ago

For now, workaround is to

  1. Restart notebook
  2. Restart argus daemon
sudo systemctl restart nvargus-daemon

Camera should then preview from notebook.

kvnptl commented 5 years ago

For now, workaround is to

1. Restart notebook

2. Restart argus daemon
sudo systemctl restart nvargus-daemon

Camera should then preview from notebook.

Thanks, it works