thien94/ORB_SLAM2_CUDA

CUDA error "cudaMallocManaged(&kpLoc, sizeof(short2) * maxKeypoints)"

Opened this issue · 3 comments

Hello,
I can build the build.sh .when I try to use ORB_slam_cuda to run dateset,it terminal came error.


ubuntu@ubuntu-Precision-Tower-5810:~/ORB_SLAM2_CUDA-master$ ./build/rgbd_tum Vocabulary/ORBvoc.txt Examples/RGB-D/TUM1.yaml /home/ubuntu/ORB_SLAM2_CUDA-master/rgbd_dataset_freiburg1_room/ /home/ubuntu/ORB_SLAM2_CUDA-master/rgbd_dataset_freiburg1_room/associate.txt

ORB-SLAM2 Copyright (C) 2014-2016 Raul Mur-Artal, University of Zaragoza.
This program comes with ABSOLUTELY NO WARRANTY;
This is free software, and you are welcome to redistribute it
under certain conditions. See LICENSE.txt.

Input sensor was set to: RGB-D

Loading ORB Vocabulary. This could take a while...
Vocabulary loaded!

Camera Parameters:

  • fx: 517.306
  • fy: 516.469
  • cx: 318.643
  • cy: 255.314
  • k1: 0.262383
  • k2: -0.953104
  • k3: 1.16331
  • p1: -0.005358
  • p2: 0.002628
  • fps: 30
  • color order: RGB (ignored if grayscale)
    CUDA error at /home/ubuntu/ORB_SLAM2_CUDA-master/src/cuda/Fast_gpu.cu:318 code=71(cudaErrorNotSupported) "cudaMallocManaged(&kpLoc, sizeof(short2) * maxKeypoints)"

Can you tell me how to solve it ? and is this program only for TX1?
Thank you very much for your help.

From NVIDIA's document, it looks like you don't have CUDA installed or version not supported.

cudaErrorNotSupported = 71
This error indicates the attempted operation is not supported on the current system or device.

I have not encountered this error before, but the program works on TX1 as well as laptop with NVIDIA GPU.

You might want to try running CUDA examples first, as explained in this thread.

First of all, thank you.
I'm every new about CUDA,before install ORB_SLAM2_CUDA ,I have ran CUDA examples.


ubuntu@ubuntu-Precision-Tower-5810:~/NVIDIA_CUDA-8.0_Samples/5_Simulations/fluidsGL$ ./fluidsGL
fluidsGL Starting...

NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.

CUDA device [NVS 315] has 1 Multi-Processors


It does not turn out cudaErrorNotSupported = 71.Is that mean I install the right version?
I rerun an CUDA example,turns out


ubuntu@ubuntu-Precision-Tower-5810:~/NVIDIA_CUDA-8.0_Samples/1_Utilities/deviceQuery$ ./deviceQuery
./deviceQuery Starting...

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "NVS 315"
CUDA Driver Version / Runtime Version 9.1 / 8.0
CUDA Capability Major/Minor version number: 2.1
Total amount of global memory: 963 MBytes (1010106368 bytes)
( 1) Multiprocessors, ( 48) CUDA Cores/MP: 48 CUDA Cores
GPU Max Clock rate: 1046 MHz (1.05 GHz)
Memory Clock rate: 875 Mhz
Memory Bus Width: 64-bit
L2 Cache Size: 65536 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65535), 3D=(2048, 2048, 2048)
Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 32768
Warp size: 32
Maximum number of threads per multiprocessor: 1536
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (65535, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 1 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device PCI Domain ID / Bus ID / location ID: 0 / 3 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 9.1, CUDA Runtime Version = 8.0, NumDevs = 1, Device0 = NVS 315
Result = PASS


I'm every new about CUDA,hope you help me ,thanks a lot .

I encountered a similar problem, it maybe your OpenCV GPU version is not correct.
First, you should check your CUDA Capability Major/Minor version number. For Jetson TX2: CUDA_ARCH_BIN="6.2" while
Jetson AGX Xavier: CUDA_ARCH_BIN="7.2" .
Then you can check your OpenCVConfig.cmake and find these lines
set(OpenCV_COMPUTE_CAPABILITIES "-gencode;arch=compute_62,code=sm_62;-D_FORCE_INLINES;")
If the compute_xx and sm_xx matches CUDA Capability , the problem is solved.