OpenCV 3.1.0 and CUDA make Error On TK1

Im realy tired of these errors on Jetson.

JetPack 3.0
CUDA 6.5

What kind of steps should i use for the GPU? I really need help guys.

I do everything that people say while installing opencv but everytime!

sudo apt-add-repository universe
sudo apt-get update

# Some general development libraries
sudo apt-get install -y build-essential make cmake cmake-curses-gui g++
# libav video input/output development libraries
sudo apt-get install -y libavformat-dev libavutil-dev libswscale-dev
# Video4Linux camera development libraries
sudo apt-get install -y libv4l-dev
# Eigen3 math development libraries
sudo apt-get install -y libeigen3-dev
# OpenGL development libraries (to allow creating graphical windows)
sudo apt-get install -y libglew1.6-dev
# GTK development libraries (to allow creating graphical windows)
sudo apt-get install -y libgtk2.0-dev

# Compile and install opencv
cd ~
mkdir src
cd src
unzip ~/Downloads/opencv-3.1.0.zip
cd opencv-3.1.0
mkdir build
cd build
cmake -DWITH_CUDA=ON -DCUDA_ARCH_BIN="5.3" -DCUDA_ARCH_PTX="" -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DCUDA_FAST_MATH=ON -DCMAKE_INSTALL_PREFIX=/home/ubuntu/opencv-3.1.0 ..

until here everything is fine.

make -j4 install

after this i got error like this:

nvcc fatal : Unsupported gpu architecture ‘compute_65’
CMake Error at cuda_compile_generated_gpu_mat.cu.o.cmake:206 (message):
Error generating
/home/ubuntu/src/opencv-3.1.0/build/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.o

make[2]: *** [modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.o] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [all] Error 2

Looks weird…I’d suggest to delete current build folder and restart from scratch.
You may try to configure with:

$ cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr/local/opencv-3.1.0 \
    -DCMAKE_CXX_FLAGS=-Wa,-mimplicit-it=thumb \
    -DBUILD_PNG=OFF \
    -DBUILD_TIFF=OFF \
    -DBUILD_TBB=OFF \
    -DBUILD_JPEG=OFF \
    -DBUILD_JASPER=OFF \
    -DBUILD_ZLIB=OFF \
    -DBUILD_EXAMPLES=ON \
    -DBUILD_opencv_java=OFF \
    -DBUILD_opencv_python2=ON \
    -DBUILD_opencv_python3=OFF \
    -DENABLE_NEON=ON \
    -DWITH_OPENCL=OFF \
    -DWITH_OPENMP=OFF \
    -DWITH_FFMPEG=ON \
    -DWITH_GSTREAMER=ON \
    -DWITH_GSTREAMER_0_10=OFF \
    -DWITH_CUDA=ON \
    -DWITH_GTK=ON \
    -DWITH_VTK=OFF \
    -DWITH_TBB=ON \
    -DWITH_1394=OFF \
    -DWITH_OPENEXR=OFF \
    -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-6.5 \
    -DCUDA_ARCH_BIN=3.2 \
    -DCUDA_ARCH_PTX="" \
    -DINSTALL_C_EXAMPLES=ON \
    -DINSTALL_TESTS=OFF \
    -DOPENCV_TEST_DATA_PATH=../opencv_extra/testdata \
    ..

then build with:

make -j3

and if it fails retry with only one process

make

After it’s successfully built, then install with

sudo make install

Thanks Honey, I have solved but i have a still main problem. I have a input video and i process the video after all im trying to show video. i can show the video but i got 1 fps.

example:

import cv2
#etc etc etc
camera = pickle.load(open( "camera_matrix.pkl", "rb" ))
mtx = camera['mtx']
dist = camera['dist']
camera_img_size = camera['imagesize']
cap = cv2.VideoCapture('project_video.mp4')
ret, frame = cap.read()


#### there are 6-7 functions here i think. IT IS EXAMPLE!###
def process_image(frame):
     return result

#####

while(ret):
    ret, frame = cap.read()
    result = process_image(frame)
   

    cv2.imshow('frame', result)
    


    if cv2.waitKey(1) & 0xFF == ord('q'):
        break


  
   
    
  

cap.release()
cv2.destroyAllWindows()

It is 1 or 2 FPS. This is my main problem, please help :(

Hi,

For performance issue, let’s tracking on topic 1016103:
[url]https://devtalk.nvidia.com/default/topic/1016103/jetson-tk1/opencv-python-and-gpu-on-tk1/post/5179846/#5179846[/url]

I had a similar problem and I had to kill the GUI to make everything build. While ssh’d in from another machine I did:
sudo service lightdm stop

that freed up enough resources to get everything to compile without a “killed” message.