Fetal nanny-level tutorial: Jetson Xavier NX image burning, boot configuration, Chinese configuration, fan settings, remote desktop, file transfer configuration, pycharm installation environment configuration, QQ, opencv (cuda compilation), torch (GPU).

1. Hardware used: nx board, original charger, wired mouse (USB), wired keyboard (USB), wired camera (USB), 7-inch touch display, 20-inch large display (one display screen is enough, Large screen is more convenient), SD card (128G, 64G can also be used), card reader, laptop (Win-11), WIFI network environment

2. Software: SDFormatter(v4), Win32DiskImager(2.0), VNC-Viewer(6.22), Winscp

3. Files: nx image file, pycharm (linux version, you can download the installation package on your laptop)

If you need the complete set of software and image files, you can leave a message. If you see it, I will reply and share it!

4. Commonly used instructions:

 // 执行目录转换
cd 文件夹名
// 返回上一级
cd ..
 // 返回到root目录
cd /
 // 返回到 /home/用户名
cd ~
// 当前目录
pwd
// 查看当前目录的所有文件(list)
ls
 // catalog
cat
 // 拷贝(copy)
cp
 // 进入python环境(python默认是python2)
python //python2

python3.8 //python3.8
 // 退出
// 快捷键:Ctrl+D,Ctrl+Z,Ctrl+C

// 查看当前已连接的设备(Jetson Xavier NX 设备会显示有 [nvidia corp])
lsusb
 
// 查看所有盘的存储情况(查看是否扩盘成功)
df -h
 
// 关机(sudo代表super user的权限)
sudo poweroff
 
// 重启
sudo reboot

 
// 安装软件(.deb文件)
sudo dpkg -i 文件名.deb
 
 
// 卸载软件(--purge是删除所有相关的东西)
sudo apt-get --surge remove sunloginclient
 
// 查看安装的所有软件
dpkg --list
 
 
// 查看jetson-stats的命令
jtop
 
// root
sudo su root

//打开管理员权限的文件管理器
nautilus



 

5. Actual startup steps

1. Download the NX image (the speed depends on the network speed, the download here is relatively slow)

Link: Jetson Download Center | NVIDIA Developer

Enter and select according to the frame

 Click the frame area command to download

2. Download pycharm (linux, this step can also be downloaded in the board after the board is turned on. I downloaded it here because the file transfer function will be configured after the board is turned on. Use this for testing) 

链接:Download PyCharm: Python IDE for Professional Developers by JetBrains

 3. Download SDFormatter(v4), Win32DiskImager(2.0), VNC-Viewer(6.22), Winscp

You can search and download SDFormatter and Win32DiskImager on the Internet. Winscp and VNC-Viewer can be downloaded using Computer Manager

SD Memory Card Formatter for Windows Download | SD Association (sdcard.org)

SDFormatter official download | SDFormatter formatting software V4.0 latest free version download_Downxia Software Park_Software Download (downxia.com)

Win32 Disk Imager download_Win32 Disk Imager official green version download_3DM software (3dmgame.com)

If you want to circumvent the firewall, you can also download it from the official websites of SDFormatter and Win32DiskImager. But the effect is actually the same.

In addition, you can also use the formatting software and burning software from the official website:

Formatting software:

SD Memory Card Formatter for Windows Download | SD Association (sdcard.org)

Burning software:

balenaEtcher - Flash OS images to SD cards & USB drives

 

4. Format SDK

Open SDFormatter

Pay attention to whether the information matches,

Confirm the SD card and then format it

 

confirm

 

confirm

 

 Close SDFormatter

5. Unzip the zip image to obtain the img file and burn it with win32diskImager

 

Select the decompressed image file, select the SD card device, and write

 

 confirm,

 Wait......................You can ignore it at this time and continue to complete the following steps.

6. Plug in the keyboard, mouse, and camera through the USB port. You can use any of the four USB ports on the board.

Adjust the position of the board and various hardware to avoid wire entanglement.

7. Connect the display through the HDMI cable at port 6 , and power on the display. If it is a small display screen, you can connect the USB power interface of the screen to the USB port of the board and use the board to power it.

8. There is still some time before the burning is completed. Let’s take a look at some related knowledge: What to do if you want to restore the burned SD card to a normal memory card: We can find that after the writing is completed, the computer cannot find the SD card and cannot It is displayed when reading the SD card (actually it is possible, but it cannot be displayed normally). This is a normal phenomenon.

How to restore it? If we do not need the SD card on the development board in the future, we will remove it and connect it to the computer with a card reader, but we cannot find the SD card and cannot open it.

We need to right-click on the computer (Win11), select Manage, and then find Disk Management

Find the disk with many partitions (such as disk 2 partition 1...all the way to disk 2 partition 18), about 10 to 20, maybe more,

Then right-click on these partitions to delete the volume. You cannot delete partitions on other disks (such as the partitions in disk 1)! , you can only delete a large number of partitions until the last one on the disk that cannot be deleted is left.

 Then find the one below, right-click to create a new volume, and be sure to follow the system steps to confirm step by step. Do not modify it, just leave everything as default. After completion, the SD card will become a normal memory card! .....................

We can see the SD card next to the C drive, D drive, and

9. After the burning is completed, pull out the SD card and insert it into the board.

 10. Power on the board

Use port 8 for power supply ! ! ! ! ! Note that you must use the matching original charging equipment for power supply! ! ! ! !

11. Boot up successfully! ! ! ! ! ! ! ! ! ! ! ! ! ! !

 12. Confirm acceptance

13. Chinese, but I have seen that there may be problems in the development process of selecting Chinese. It is best to accept English.

 13. Ignore the keyboard settings and continue by default.

14. Connect to the Internet

 15. Any region, continue by default

 16. Username and password settings

 17. Space defaults to maximum continuation

 18. Basic configuration completed and automatic loading

 19. Select the login user and enter the password you set.

 20. Enter the desktop

 Here are some shortcut keys to learn about

But I don’t know why it changed to English again, but it’s not a big problem, so ignore it and continue.

 21. Then you can install some software, such as this pycharm. I will not install it here and skip to continue.

 22. Finally, witness the success, the radiant desktop, and the boot is complete! Like it and save it! ! ! !

It’s really a fetal nanny tutorial.

 6. Browser settings

The default Google engine of Google Chrome cannot be used in China without a ladder. We can change the engine or Baidu Bing.

Open the browser settings to other domestic engines

7. Chinese input method and Chinese system environment

1. Download Google input method: sudo apt-get install fcitx-googlepinyin -y

 Download completed:

2. Open settings/settings, you can search for language support/language in the upper right corner of the screen or click on the search bar.

 

 

3. It prompts that the installation is incomplete, continue the installation (you need to enter the password to confirm after clicking the installation, and the installation will take a while)

 

4. After the installation is complete, it will Keyboard input method systembe set tofcitx

 将中文拖到最上面,按住直接往上拖就行

Apply to the entire system

Then restart and it's done

You can restart by clicking on the upper right corner of the screen -> Shut down -> Restart

Or use the ctrl+alt+T shortcut key to open the terminal and enter reboot to restart the development board.

After restarting, it will become a Chinese environment, such as the entire user login page.

 

 

Click the entire keyboard icon to select the Chinese input method, any one will work, or use the shortcut key "ctrl+spacebar" 

You can enter Chinese

8. Change source

1 Enter the command:

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak
sudo  vim  /etc/apt/sources.list

Delete or comment out the previous one (comment with #)

Press 'a' to insert. After writing, press the esc key and enter ':wq! 'Save and exit

Then enter the update command in the terminal: sudo apt-get update

#Join Tsinghuayuan, or others such as Alibaba Cloud, University of Science and Technology of China, Douban, etc.
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb-src http: //mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
deb -src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main universe restricted
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main universe restricted
 

9. Set up cuda, add environment variables, and nvcc -V detection

1. First use the command ' nvcc -V' to detect 

 If there is no configuration, it will display that the command cannot be found:
terminal input: sudo gedit ~/.bashrc

Add a blank space at the bottom of the opened text box, and then add the path:

export CUDA_HOME=/usr/local/cuda-10.2
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH
export PATH=/usr/local/cuda-10.2/bin:$PATH

Finally, use the command ' nvcc -V' to detect and it is successful. 

10. Download pip

1. Generally, there is no built-in pip, such as this example

 2. Then we use the command to download pip: sudo apt-get install python3-pip

3. You still need to download a lot of dependent libraries. Please go to other blogs to find this. Try to download as many as possible, otherwise you may encounter many strange problems in the future.

 For example, this blogger: (1 message) jetson xavier nx system and related environment configuration (cuda, torchvision, torch, tensorflow, opencv)_My serious illness blog-CSDN blog

11. Install Jtop to control the fan and set the fan

1. Install the hardware temperature detection tool sensors

sudo apt install lm-sensors

Input: sensors

2. Installation:

sudo pip3 install jetson-stats

After the installation is complete, enter: sudo jtop to start, click No. 5, if it is different from mine, enlarge the window. The window is too small to be displayed, and it is incomplete.

 

 

 The fan turns

 Other bloggers also control through commands or scripts, and you can also refer to their methods.

12. Set up remote desktop (refer to the method of a blogger (Childhood Elegance) in the short book)

Jetson builds and configures VNC Server (Xavier/Nano/NX...) - Jianshu (jianshu.com)

1. Install Vino. Usually it comes with the installation. You can also try it with the command.

 sudo apt install vino

The board I use here comes with it and has been installed.

Then, this blogger is the instruction method, and you can also open the software "Desktop Sharing" (search for share settings in the search bar)

After starting vino-server, use ctrl+Z to exit, and then continue below 

 

 

 Resolution 1920x1080 can be modified according to the actual computer screen

3. Download VNC Viewer and WinSCP on your computer

Connect the computer and development board to the same hotspot

Open the mobile phone's personal hotspot, find the connected device, click on it, see the IP address of the device connected to the hotspot, and write down the IP address of the development board.

Open VNC Viewer on your computer

There will be this warning when connecting for the first time. Choose not to be prompted and continue.

 

 Open winscp and transfer files

The host name is the IP address, the username and password are the username and password set by the development board, and the port does not need to be changed. 

 After the connection is successful, you can create a shortcut from the workspace to the desktop. Click the shortcut to connect directly next time.

13. pycharm installation and configuration

1. Before installing pycharm we need to configure Java

Here are two blogs java-11 and java-8

java-11:

(1 message) Jetson AGX Xavier installation Pycharm_Weibai's tail's blog-CSDN blog

java-8:

(1 message) Installing Pycharm on Jetson Xavier NX_Suyuoa's Blog-CSDN Blog

It doesn’t matter if it’s Java11 or Java8.

But note: you cannot install two! !

Although there will be no problems during installation, an error will be reported when opening pycharm later. The reason is that java11 is used to run the Java8 environment or vice versa. In short, we can choose one to install. I chose java11 here.

sudo apt-get install openjdk-11-jdk

java --version #Check whether the installation is successful

sudo vim ~/.bashrc #Configure environment variables and add the following four lines at the bottom of the opened text

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

Click to save and then close

source ~/.bashrc #Refresh

If there is a problem downloading two, don’t panic. Just uninstall all versions of JDK and re-select a configuration through the following three instructions.

dpkg --list | grep -i jdk
apt-get purge jdk*
apt-get purge icedtea-* jdk-*

In addition, if you accidentally write the wrong environment variables like me, most of the commands will fail.

You can temporarily restore it by typing in the terminal. If restarting the terminal still doesn't work, you need to type it again.

 export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

How to solve:

First enter the terminal to temporarily restore, and pass the command

sudo runs ~/.bashrc

Open the text and change the following sentence

export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

 Add to bottom

then refresh

source ~/.bashrc


You can continue to reconfigure

2. Download pycharm-Linux version

Download link:

Download PyCharm: Python IDE for Professional Developers by JetBrains

I downloaded it on my computer in advance and used winscp to transfer it to the main directory on the board.

Unzip the downloaded package. I personally feel that manual decompression is faster than the command line (because everyone’s path may be different), and then change the folder to pycharm (remove the version number suffix)

 Open the pychrm folder, enter the bin directory, and find the pycharm.sh file.

Open the terminal and drag pycharm.sh into the terminal. The command will automatically appear. Remove the first two quotation marks ( ' ' ).

Just press Enter and run.

 

 

 3. After entering, configure the Chinese environment (you can skip it if not required)

 

 

 After downloading the plug-in, you need to restart it, and then the Chinese version will be available.

 

4. Create a project. If there is no project, create a new one. If there is one, open it. Here is a new one. 

After the selection is completed, confirm and you can open it.

 

5. Add shortcut

 

 

 

 6. Add library: File --> Settings

 

 

7. Use the terminal command in pycharm to download the library pytorch (CPU version, GPU version below)

First update pip

python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple

 Enter the official website: PyTorch

Scroll down, select version 1.12.1, Linux, pip, python, cuda10.2 (we used the nvcc -V command to view it before), and copy the generated link to the terminal to download. 

 

Just wait until it is downloaded. The dependent library files will be automatically configured, but the download may fail midway, so you need to pay attention to the download situation and try again if it fails.

7.2. Terminal command in pycharm downloads the library pytorch (GPU version)

You need to go to the official website of pytorch for jetson (a website dedicated to jetson), where you can download the corresponding torch version. If you go directly to the torch official website, you may not be able to find a suitable version. Even if there is a corresponding version downloaded and used, there may be problems.

Jetpack has installed cuda and cudnn by default, so you only need to install torch. Note that jetson is an arm architecture and you need to download the corresponding installation file to install it.

General: Pay attention to python version, cuda version, arm architecture

PyTorch for Jetson - Jetson & Embedded Systems / Jetson Nano - NVIDIA Developer Forums

After downloading the whl wheel, you can install it in the terminal or pycharm.

终端:pip3 install torch-1.4.0-cp36-cp36m-linux_aarch64.whl

pycharm:pip install torch-1.4.0-cp36-cp36m-linux_aarch64.whl

After installing torch, you need to download torchvision for complete functionality.

You can download and install directly from the corresponding website: GitHub - pytorch/vision: Datasets, Transforms and Models specific to Computer Vision

You can also use the command to clone it (cloning may fail. After I cloned it myself, the installation failed and the reason was unclear. Then I downloaded it directly from github and reinstalled it successfully)

/// 终端

git clone https://github.com/pytorch/vision torchvision
cd torchvision


#如果有多个python3的版本,最好指定清楚一些,直接python的话可能安装到python2了
sudo python3 setup.py install 

#如python3.6
sudo python3 setup.py install

///


/// pycharm

git clone https://github.com/pytorch/vision torchvision
cd torchvision

python setup.py install

///

 8. Use mirror download

For the window version, you can add the mirror source in the settings, so you don’t have to enter it every time. However, there is a problem with the Linux version. It does not have this function and needs to be entered every time. There is also a problem with Python Packages. This function does not take effect, otherwise it will be fine. It makes downloading more convenient.

Tsinghua: https://pypi.tuna.tsinghua.edu.cn/simple

Alibaba Cloud: http://mirrors.aliyun.com/pypi/simple/

University of Science and Technology of China https://pypi.mirrors.ustc.edu.cn/simple/

Huazhong University of Science and Technology: http://pypi.hustunique.com/

Shandong University of Technology: http://pypi.sdutlinux.org/

Douban: http://pypi.douban.com/simple/

When using pip in the pycharm terminal, add the parameter "-i" + mirror source

For example: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pillow

9. Download opencv (non-cuda compilation)

pip install opencv-python --user -i https://pypi.tuna.tsinghua.edu.cn/simple

Using this command to download opencv will usually automatically download some dependent libraries, but just in case, add one more

pip install opencv-contrib-python --user -i https://pypi.tuna.tsinghua.edu.cn/simple

9. Download opencv (cuda compiled version, which is more troublesome and takes a long time. You don’t need to configure it if it is not necessary)

        9.1 First uninstall the built-in opencv (the built-in opencv does not have cuda compilation, you can use jtop to check the situation)

sudo apt-get remove libopencv*
sudo apt-get purge libopencv* python-opencv 
sudo apt-get update
sudo apt-get install -y build-essential pkg-config
查看opencv安装库:pkg-config opencv --libs
查看opencv安装版本:pkg-config opencv --modversion

        9.2 Download the dependent library (When I installed this dependent library, I found many bloggers on the Internet and downloaded them all. Some of them seemed to have failed to download the library. Then I copied the problem to Baidu and solved it. I don’t remember exactly what it was. It’s still relatively easy to solve)

I have read the following bloggers when I was configuring them for the first time. They wrote quite well. If the configuration is not good according to my method, you can read theirs.

Jetson Xavier NX installs cuda opencv4.4.0 - Jianshu (jianshu.com)

(4 messages) Jetson nano/NX install Opencv Cuda version_one_DS's blog-CSDN blog_nano install opencv

Jetson Xavier NX OpenCV installation - Zhihu (zhihu.com)

(4 messages) Jetson opencv4.5 with CUDA compilation installation tutorial and pitfall guide, cmake configuration is very important! _I am the blog of Yuning-CSDN blog

sudo apt-get install -y cmake libavcodec-dev libavformat-dev libavutil-dev \
    libglew-dev libgtk2.0-dev libgtk-3-dev libjpeg-dev libpng-dev libpostproc-dev \
    libswscale-dev libtbb-dev libtiff5-dev libv4l-dev libxvidcore-dev \
    libx264-dev qt5-default zlib1g-dev libgl1 libglvnd-dev pkg-config \
    libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev mesa-utils     

sudo apt-get install python2.7-dev python3-dev python-numpy python3-numpy

sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev


sudo apt install -y build-essential checkinstall cmake pkg-config yasm git gfortran
sudo apt update
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt install -y libjpeg8-dev libjasper-dev libpng12-dev libtiff5-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2-dev libv4l-dev
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgtk2.0-dev libtbb-dev libatlas-base-dev libfaac-dev libmp3lame-dev libtheora-dev libvorbis-dev libxvidcore-dev libopencore-amrnb-dev libopencore-amrwb-dev x264 v4l-utils
sudo apt install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

sudo apt-get install build-essential \
libavcodec-dev \
libavformat-dev \
libavutil-dev \
libeigen3-dev \
libglew-dev \
libgtk2.0-dev \
libgtk-3-dev \
libjpeg-dev \
libpostproc-dev \
libswscale-dev \
libtbb-dev \
libtiff5-dev \
libv4l-dev \
libxvidcore-dev \
libx264-dev \
qt5-default \
zlib1g-dev \
libavresample-dev \
gstreamer1.0-plugins-bad \
pkg-config

        9.3 Download the opencv and opencv_contrib packages. You can download them from the opencv official website or Github resources, but the version must correspond. It has reached version 4.6 but it is not recommended to download 4.6. Although I successfully configured opencv4.6 for the first time, it will be used later. There was a problem at the time, and it was a bit incompatible with other libraries. It is recommended to use version 4.5.3.

Releases - OpenCV

Releases · opencv/opencv_contrib · GitHub

 

        9.4 After downloading the two compressed packages, unzip them, modify the file name, remove the version number, and put the opencv-contrib folder into the opencv folder.

        9.5 Enter the opencv folder directory and create a build folder

cd xx/xx/xx/xx/xx/opencv
mkdir build
cd build

        9.6 Configure cmake

If there are multiple python2 versions or python3 versions, please specify them.

When I first installed it, I just chose not to install it in python2.

I didn't specify a specific python3 version, so it ended up being installed on python3.9, and python3.6 couldn't be used. As a result, I finally had to reinstall, which wasted a lot of time.

Then about the meaning of the instruction (0 and 1 are the corresponding off and on)

-D CMAKE_BUILD_TYPE=Release \ // Release compiled version
-D CMAKE_INSTALL_PREFIX=/usr/local \ // Installation path
-D OPENCV_ENABLE_NONFREE=1 \
-D BUILD_opencv_python2=0 \ // Setting 0 means not configuring the python2 environment
-D BUILD_opencv_python3=1 \
-D WITH_FFMPEG=1 \
-D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \ //This path needs to be confirmed by yourself, if it has been modified

It may be /usr/local/cuda-10.2
-D CUDA_ARCH_BIN=7.2 \ //For computing power, check the actual computing power of the GPU on the NVIDIA official website, or in the data manual when buying the development board
-D CUDA_ARCH_PTX=7.2 \
-D WITH_CUDA=1 \ //Use cuda
-D ENABLE_FAST_MATH=1 \
-D CUDA_FAST_MATH=1 \
-D WITH_CUBLAS=1
\ -D OPENCV_GENERATE_PKGCONFIG=1 \
-D OPENCV_EXTRA_MODULES_PATH=xx/xx/opencv_contrib/modules //Just download the opencv_contrib module path

The following two are copied from two other bloggers (I don’t remember which one I used specifically, they should all work, just modify it slightly according to your own environment)

cmake \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_ENABLE_NONFREE=1 \
-D BUILD_opencv_python2=0 \
-D BUILD_opencv_python3=1 \
-D WITH_FFMPEG=1 \
-D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda \
-D CUDA_ARCH_BIN=7.2 \
-D CUDA_ARCH_PTX=7.2 \
-D WITH_CUDA=1 \
-D ENABLE_FAST_MATH=1 \
-D CUDA_FAST_MATH=1 \
-D WITH_CUBLAS=1 \
-D OPENCV_GENERATE_PKGCONFIG=1 \
-D OPENCV_EXTRA_MODULES_PATH=xx/xx/opencv_contrib/modules \
..
cmake 
        -D CMAKE_BUILD_TYPE=RELEASE \
        -D CMAKE_INSTALL_PREFIX=/usr/local \
        -D WITH_CUDA=ON \
        -D CUDA_ARCH_BIN=6.2 \
        -D CUDA_ARCH_PTX="" \
        -D ENABLE_FAST_MATH=ON \
        -D CUDA_FAST_MATH=ON \
        -D WITH_CUBLAS=ON \
        -D WITH_LIBV4L=ON \
        -D WITH_GSTREAMER=ON \
        -D WITH_GSTREAMER_0_10=OFF \
        -D WITH_QT=ON \
        -D WITH_OPENGL=ON \
        -D CUDA_NVCC_FLAGS="--expt-relaxed-constexpr" \
        -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.2 \
        -D WITH_TBB=ON \
        -D OPENCV_EXTRA_MODULES_PATH=~/xxx/xxx/opencv/opencv_contrib/modules \
         ../

After running the cmake command, don't rush to the next step. Carefully look at the information output at the bottom, including which python is installed, and whether the cuda path is found............. .

Very important, very important. Very important, be sure to confirm before compiling

        9.5 compilation, takes 3-5 hours,

make -j4         j4代表用四核跑,我当时用的j6,六核,但是需要先调整位六核mode

        9.6 Installation,

sudo make install

If it shows that the installation is successful, then the configuration is basically successful.

Use jtop to check whether the compiled cuda status of opencv has changed to True.

 Then enter python3.6 (according to your own version). If you are installing python2, enter python2

import cv2

cv2.__version__

If the version number is output, the configuration is successful.

 

10. Some versions of python do not have the Tkinter library, so you have to configure it yourself.

sudo apt-get update

sudo apt-get install python3-tk

sudo apt-get install -f

Guess you like

Origin blog.csdn.net/qq_55906687/article/details/126728718