Can't use Jetson-inference on Drive PX2

I’m trying to use Jetson-inference on Drive PX2(Auto Chauffeur).
Following the site below, I’ve done to “make” Jetson-inference on DRIVE PX2.
https://github.com/dusty-nv/jetson-inference

However, trying to do an “orange classify” results in the following log and cannot be classified

I found a similar issue on the site below, but I could not solve it.
<https://devtalk.nvidia.com/default/topic/1023362/general/issues-with-tensorrt-on-drive-px2 />

Is it possible to use Jetson inference on DrivePX platform ?

$ ./imagenet-console orange_0.jpg output_0.jpg

imagenet-console args
 (3): 0 [./imagenet-console] 1 [orange_0.jpg] 2 [output_ 0.jpg] 

imageNet - loading classification network model from:
         - prototxt networks / googlenet.prototxt
         - model networks / bvlc_googlenet.caffemodel
         - class_labels networks / ilsvrc12_synset_words.txt
         - input_blob 'data'
         - output_blob 'prob'
         - batch_size 2

[GIE] TensorRT version 3.0.2, build 3002 [GIE] attempting to open cache file networks / bvlc_googlenet.caffemodel.2.tensorcache
[GIE] loading network profile from cache ...
networks / bvlc_googlenet.caffemodel.2.tensorcache
nvrm_gpu: Bug 200215060 workaround enabled.
[GIE] platform does not have FP16 support.
[GIE] networks / bvlc_googlenet.caffemodel loaded [GIE] CUDA engine context initialized with 2 bindings [GIE] networks / bvlc_googlenet.caffemodel input binding index: 0 [GIE] networks / bvlc_googlenet.caffemodel input dims (b = 2 c = 3 h = 224 w = 224) size = 1204224 [cuda] cudaAllocMapped 1204224 bytes, CPU 0x1053e0000 GPU 0x1053e0000 [GIE] networks / bvlc_googlenet.caffemodel output 0 prob binding index: 1 [GIE] networks / bvlc_googlenet.caffemodel output 0 prob mds (b = 2 c = 1000 h = 1 w = 1) size = 8000 [cuda] cudaAllocMapped 8000 bytes, CPU 0x1055e0000 GPU 0x1055e0000 networks / bvlc_googlenet.caffemodel initialized.
[GIE] networks / bvlc_googlenet.caffemodel loaded imageNet - loaded 1000 class info entries networks / bvlc_googlenet.caffemodel initialized.
loaded image orange_0.jpg (1920 x 1920) 58982400 bytes [cuda] cuda AllocMapped 58982400 bytes, CPU 0x1057e0000 GPU 0x1057e0000 [cuda] cudaGetLastError () [cuda] no kernel image is available for execution on the device (error
48) (hex 0 x 30)
[cuda] /home/nvidia/jetson-inference/imageNet.cu:115
[cuda] cudaPreImageNetMean ((float 4 *) rgba, width, height, mInputCUDA, mWidth, mHeight, make_float 3 (104.0069879317889 f, 116.66876761696767 f,
122.6789143406786 f))
[cuda] no kernel image is available for execution on the device (error
48) (hex 0 x 30)
[cuda] /home/nvidia/jetson-inference/imageNet.cpp:296
imageNet :: Classify () - cudaPreImageNetMean failed
imagenet-console: failed to classify 'orange_ 0.jpg' (result = -1)

shutting down ...

Hi,

CUDA error 48 means no available kernel image for the device.
This usually occurs when a user doesn’t generate code with the corresponding device configuration.

Jetson_inference is a sample for Jetson platform and doesn’t includes the GPU architecture of PX2.
Please modify the configuration with following change to add PX2 GPU support.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3026acc..82b4bc5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,7 +33,7 @@ set(
        CUDA_NVCC_FLAGS
        ${CUDA_NVCC_FLAGS}; 
     -O3 
-       -gencode arch=compute_53,code=sm_53
+       -gencode arch=compute_61,code=sm_61
        -gencode arch=compute_62,code=sm_62
 )

Thanks.

Hi,

may I asked you, how you were able to compile the jetson-inference project for the Drive PX2?
I am trying this, too, but I am not able to get it run.

Thank you for your help!
Best regards

Hi, AastaLLL.

After modifying CMakeLists.txt according to your advice and cmake it again,
the console command of classify was executed.
Thank you for your advice!

Next step.

I tried using webcam to recognize by jetson-inference command “./Imagenet-camera”.
However, the image of the web camera was black.
Do I need to set something?

I’m using Logicool C922 web camera.
I confirmed that the web camera can operate by using the command “/usr/local/driveworks/bin/sample_camera_usb --device=0”.

The log when executing the command “./imagenet-camera” is as follows

$ ./imagenet-camera
imagenet-camera
  args (1):  0 [./imagenet-camera]  

[gstreamer] initialized gstreamer, version 1.8.2.0
[gstreamer] gstreamer decoder pipeline string:
v4l2src device=/dev/video0 ! video/x-raw, width=(int)1280, height=(int)720, format=RGB ! videoconvert ! video/x-raw, format=RGB ! videoconvert !appsink name=mysink

imagenet-camera:  successfully initialized video device
    width:  1280
   height:  720
    depth:  24 (bpp)


imageNet -- loading classification network model from:
         -- prototxt     networks/googlenet.prototxt
         -- model        networks/bvlc_googlenet.caffemodel
         -- class_labels networks/ilsvrc12_synset_words.txt
         -- input_blob   'data'
         -- output_blob  'prob'
         -- batch_size   2

[GIE]  TensorRT version 3.0.2, build 3002
[GIE]  attempting to open cache file networks/bvlc_googlenet.caffemodel.2.tensorcache
[GIE]  loading network profile from cache... networks/bvlc_googlenet.caffemodel.2.tensorcache
nvrm_gpu: Bug 200215060 workaround enabled.
[GIE]  platform does not have FP16 support.
[GIE]  networks/bvlc_googlenet.caffemodel loaded
[GIE]  CUDA engine context initialized with 2 bindings
[GIE]  networks/bvlc_googlenet.caffemodel input  binding index:  0
[GIE]  networks/bvlc_googlenet.caffemodel input  dims (b=2 c=3 h=224 w=224) size=1204224
[cuda]  cudaAllocMapped 1204224 bytes, CPU 0x1053e0000 GPU 0x1053e0000
[GIE]  networks/bvlc_googlenet.caffemodel output 0 prob  binding index:  1
[GIE]  networks/bvlc_googlenet.caffemodel output 0 prob  dims (b=2 c=1000 h=1 w=1) size=8000
[cuda]  cudaAllocMapped 8000 bytes, CPU 0x1055e0000 GPU 0x1055e0000
networks/bvlc_googlenet.caffemodel initialized.
[GIE]  networks/bvlc_googlenet.caffemodel loaded
imageNet -- loaded 1000 class info entries
networks/bvlc_googlenet.caffemodel initialized.
default X screen 0:   2960 x 1050
[OpenGL]  glDisplay display window initialized
[OpenGL]   creating 1280x720 texture
loaded image  fontmapA.png  (256 x 512)  2097152 bytes
[cuda]  cudaAllocMapped 2097152 bytes, CPU 0x1057e0000 GPU 0x1057e0000
[cuda]  cudaAllocMapped 8192 bytes, CPU 0x1055e2000 GPU 0x1055e2000
[gstreamer] gstreamer transitioning pipeline to GST_STATE_PLAYING
[gstreamer] gstreamer changed state from NULL to READY ==> mysink
[gstreamer] gstreamer changed state from NULL to READY ==> videoconvert1
[gstreamer] gstreamer changed state from NULL to READY ==> capsfilter1
[gstreamer] gstreamer changed state from NULL to READY ==> videoconvert0
[gstreamer] gstreamer changed state from NULL to READY ==> capsfilter0
[gstreamer] gstreamer changed state from NULL to READY ==> v4l2src0
[gstreamer] gstreamer changed state from NULL to READY ==> pipeline0
[gstreamer] gstreamer changed state from READY to PAUSED ==> videoconvert1
[gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter1
[gstreamer] gstreamer changed state from READY to PAUSED ==> videoconvert0
[gstreamer] gstreamer changed state from READY to PAUSED ==> capsfilter0
[gstreamer] gstreamer stream status CREATE ==> src
[gstreamer] gstreamer changed state from READY to PAUSED ==> v4l2src0
[gstreamer] gstreamer changed state from READY to PAUSED ==> pipeline0
[gstreamer] gstreamer stream status ENTER ==> src
[gstreamer] gstreamer msg new-clock ==> pipeline0
[gstreamer] gstreamer msg stream-start ==> pipeline0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> videoconvert1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter1
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> videoconvert0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> capsfilter0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> v4l2src0

imagenet-camera:  camera open for streaming
[gstreamer] gstreamer decoder onPreroll
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x1059e0000 GPU 0x1059e0000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x105c90000 GPU 0x105c90000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x105f40000 GPU 0x105f40000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x1061f0000 GPU 0x1061f0000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x1064a0000 GPU 0x1064a0000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x106750000 GPU 0x106750000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x106a00000 GPU 0x106a00000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x106cb0000 GPU 0x106cb0000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x106f60000 GPU 0x106f60000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x107210000 GPU 0x107210000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x1074c0000 GPU 0x1074c0000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x107770000 GPU 0x107770000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x107a20000 GPU 0x107a20000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x107cd0000 GPU 0x107cd0000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x107f80000 GPU 0x107f80000
[cuda]  cudaAllocMapped 2764800 bytes, CPU 0x108230000 GPU 0x108230000
[cuda]   gstreamer camera -- allocated 16 ringbuffers, 2764800 bytes each
[gstreamer] gstreamer changed state from READY to PAUSED ==> mysink
[gstreamer] gstreamer msg async-done ==> pipeline0
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> mysink
[gstreamer] gstreamer changed state from PAUSED to PLAYING ==> pipeline0
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x1084e0000 GPU 0x1084e0000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x1092f0000 GPU 0x1092f0000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x10a100000 GPU 0x10a100000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x10af10000 GPU 0x10af10000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x10bd20000 GPU 0x10bd20000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x10cb30000 GPU 0x10cb30000
[gstreamer] gstreamer msg qos ==> v4l2src0
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x10d940000 GPU 0x10d940000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x10e750000 GPU 0x10e750000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x10f560000 GPU 0x10f560000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x110370000 GPU 0x110370000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x111180000 GPU 0x111180000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x111f90000 GPU 0x111f90000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x112da0000 GPU 0x112da0000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x113bb0000 GPU 0x113bb0000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x1149c0000 GPU 0x1149c0000
[cuda]  cudaAllocMapped 14745600 bytes, CPU 0x1157d0000 GPU 0x1157d0000
[cuda]   gstreamer camera -- allocated 16 RGBA ringbuffers
class 0475 - 0.283953  (car mirror)
class 0605 - 0.014470  (iPod)
class 0632 - 0.010347  (loudspeaker, speaker, speaker unit, loudspeaker system, speaker system)
class 0662 - 0.029539  (modem)
class 0664 - 0.098564  (monitor)
class 0782 - 0.026043  (screen, CRT screen)
class 0785 - 0.363981  (seat belt, seatbelt)
class 0851 - 0.013250  (television, television system)
class 0859 - 0.040571  (toaster)
imagenet-camera:  36.39809% class #785 (seat belt, seatbelt)
class 0475 - 0.297077  (car mirror)
class 0605 - 0.010207  (iPod)
class 0632 - 0.011224  (loudspeaker, speaker, speaker unit, loudspeaker system, speaker system)
class 0662 - 0.027714  (modem)
class 0664 - 0.093532  (monitor)
class 0782 - 0.026952  (screen, CRT screen)
class 0785 - 0.378346  (seat belt, seatbelt)
class 0851 - 0.012728  (television, television system)
class 0859 - 0.037469  (toaster)

Hi,

Please build it with this command:
https://github.com/dusty-nv/jetson-inference#cloning-the-repo

Please also remember to update the change in comment #2.
Thanks.

Hi, h-kinumatsu

The source code to open a USB camera is designed for Jetson.
Please update the configuration here:
https://github.com/dusty-nv/jetson-inference/blob/master/util/camera/gstCamera.cpp#L321

Thanks.

Hi, AastaLLL.

Thank you for your comment.

According to comment #7,
it updates the content of the function “gstCamera::buildLaunchStr()” of gstCamera.cpp,
How do I update it?

I will supplement the comment #5 and #8.

When executing jetson-inference command “./Imagenet-camera”,
looking at the console screen, it seems to be recognizing somewhat.
However, the image of the web camera is black.

Executing the DriveWorks command “/usr/local/driveworks/bin/sample_camera_usb --device=0”,
the web camera moves normally.
From this, I think there is no abnormality in the web camera.

I got advice at comment #7, but I do not know where to update concretely.
I tried running it with the latest gstCamera.cpp, but the result did not change.

If you have any advice, please let me know.

Best regards.


I solved my self.
I referred to the following site.
https://github.com/dusty-nv/jetson-inference/issues/232

First change line 154 of imagenet-camera.cpp as follows.
if( !camera->ConvertRGBA(imgCUDA, &imgRGBA, true) )

Then comment out lines 197-204 of imagenet-camera.cpp and change it as follows.

// map from CUDA to openGL using GL interop
/* void* tex_map = texture->MapCUDA();

if( tex_map != NULL )
{
cudaMemcpy(tex_map, imgRGBA, texture->GetSize(), cudaMemcpyDeviceToDevice);
texture->Unmap();
} */

CUDA(cudaDeviceSynchronize());
texture->UploadCPU(imgRGBA);

After this I ran the make, I could classify it through the web camera.

I changed detectnet-camera.cpp and segnet-camera.cpp in the same way,
I could detect and segmentation through web camera.
However, segnet-camera.cpp needs to be
texture->UploadCPU(outCUDA);
instead of
texture->UploadCPU(imgRGBA);

I apologize to you for a fuss over.
Best regards.

Thanks to share this information with us and also sorry for our late reply.