Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column
width50%
Panel
borderColor#CCCCCC
bgColor#FFFFFF
titleBGColor#F0F0F0
borderStylesolid
titleOn the page:

Table of Contents

Column

Tip

Creating system variables for the Axxon One server in Linux OS

Creating system variables for the Axxon One server in the failover mode in Linux OS

General information

It can take several minutes to launch neural analytics algorithms on Nvidia GPU after server restart. Meanwhile, the neural models are optimized for the current GPU type.

You can use the caching function to ensure that this operation is performed only once. Caching saves the optimization results on the hard drive and uses it them for the subsequent analytics runs. 

Starting with DetectorPack 3.9, a utility was added to the Neuro Pack add-ons (see Installing DetectorPack add-ons), which allows you to create GPU neural network caches without using Axxon One. The presence of the cache speeds up the initialization and optimizes video memory consumption.

Optimizing the operation of neural analytics on GPU

To optimize the operation of the neural analytics on GPU, do the following:

  1. Stop the server (see Starting and stopping the Axxon One Server in Linux OS).

    Note
    titleAttention!

    If the system has the software running on GPU,

  2. it is necessary to
  3. you must stop its operation.

  4. Login as ngp superuser:

    1. In the command prompt, run the command:

      Code Block
      languagebash
      sudo su ngp
    2. Enter the password for the

  5. root
    1. superuser.

  6. Create a folder with a custom name to store the cache. For example:

    Code Block
    languagebash
    mkdir /opt/AxxonSoft/AxxonOne/gpucache
  7. Change folder permissions:

    Code Block
    languagebash
    chmod -R 777 /opt/AxxonSoft/AxxonOne/gpucache
  8. Create the GPU_CACHE_DIR system variable:

  9. Go to the /opt/AxxonSoft/AxxonOne

  10. / folder
  11.  folder:

    Code Block
    languagebash
    cd /opt/AxxonSoft/AxxonOne
  12. Open the server configuration file for editing:
    Code Block
    languagebash
    nano instance.conf
    Note
    titleAttention!

    When you use the server in failover mode, you should:

    1. Open the /etc/AxxonSoft folder:
      Code Block
      languagebash
      cd /etc/AxxonSoft
    2. Open the server configuration file for editing:
      Code Block
      languagebash
      nano 
  13. instance
    1. axxon-one.conf
      Info
      titleAttention!
  14. Add the following line to the
    1. Before you make changes to the axxon-one.conf file, we recommend reading the instructions on the page Creating system variables for the Axxon One server in the failover mode in Linux OS.

    2. Add the GPU_CACHE_DIR system variable in the configuration file, wherethevaluewillspecify the pathto the cachelocationfolder:
      Code Block
      languagebash
      export GPU_CACHE_DIR="/opt/AxxonSoft/AxxonOne/gpucache"
    3. Save the changes in the server configuration file.
    4. Add the GPU_CACHE_DIR system variable in the /etc/profile file:
      Code Block
      languagebash
      export GPU_CACHE_DIR="/opt/AxxonSoft/AxxonOne/gpucache"
    5. Run the command:
      Code Block
      languagebash
      source /etc/profile
  15. Add the GPU_CACHE_DIR system variable,wherethevaluewillspecify the pathto the cachelocationfolder. For example:

    Code Block
    languagebash
    export GPU_CACHE_DIR="/opt/AxxonSoft/AxxonOne/gpucache"
  16. Save the server configuration file using the Ctrl+O keyboard shortcut.

  17. Exit file editing mode using the Ctrl+X keyboard shortcut.

    Note
    titleAttention!
  18. If
  19. When you change the server configuration (see Changing the configuration of the Axxon One Server in Linux OS) or update to

  20. a
  21. the new

  22. version of
  23. Axxon One version, the system variables previously added to the instance.conf configuration file will be deleted (see Creating system variables for the Axxon One server in Linux OS).

  24. Save the file using the Ctrl+O keyboard shortcut.

  25. Exit file editing mode using the Ctrl+X keyboard shortcut.

  26. Run the following command in the terminal
  27. In the command prompt, run the command that was usedtoadd the systemvariablewiththepathto the cache location folder. For example:
    Code Block
    languagebash
    export GPU_CACHE_DIR="/opt/AxxonSoft/AxxonOne/gpucache"
  28. Go to the /opt/AxxonSoft/DetectorPack/ folder:

    Code Block
    languagebash
    cd /opt/AxxonSoft/DetectorPack
  29. Run the following command:

    Code Block
    languagebash
    ./NeuroPackGpuCacheGenerator
    Note
    titleAttention!

    If more than one Nvidia GPU is available, you will be able to select one. To do this, specify a number from 0 to 3, which corresponds to the required device in the list.

Optimizing the operation of the neural analytics on GPU is complete. The utility will create the caches of four neural networks included in the Neuro Pack add-ons:

  • GeneralNMHuman_v1.0GPU_onnx.ann—person;
  • smokeScanned_v1_onnx.ann (or bestSmoke_v1.ann starting with Detector Pack 3.14)—smoke detection;
  • fireScanned_v1_onnx.ann (or bestFire_v1.ann starting with Detector Pack 3.14)—fire detection;
  • reid_15_0_256__osnetfpn_segmentation_noise_20_common_29_onnx.ann—search for the similar in the Neural tracker (see Similitude search).

Creating GPU neural network caches using parameters

  1. -p is a parameter to create a cache for a particular neural network.
    Command example:

    Code Block
    ./NeuroPackGpuCacheGenerator -p /opt/AxxonSoft/DetectorPack/NeuroSDK/GeneralNMHumanAndVehicle_Nano_v1.0_GPU_onnx.ann
  2. -v is a parameter to output the procedure log to the console during cache generation.
    Command example to automatically create caches of four neural networks included in the Neuro Pack add-ons with log output:

    Code Block
    ./NeuroPackGpuCacheGenerator -v
  3. --int8=1 is a parameter to create a quantized version of the cache for those neural networks for which quantization is available. By default, the --int8=0 parameter is disabled.
    Command example:

    Code Block
    ./NeuroPackGpuCacheGenerator -p /opt/AxxonSoft/DetectorPack/NeuroSDK/GeneralNMHumanAndVehicle_Nano_v1.0_GPU_onnx.ann --int8=1
    Note
    titleAttention!

    The neural networks for which the quantization mode is available are included in the Neuro Pack add-ons together with the *.info file.

The neural networks for which the quantization mode is available (see Neural trackerStopped object detectorNeural counter):

  • GeneralNMCar_v1.0GPU_onnx.ann—Vehicle.
  • GeneralNMHuman_v1.0GPU_onnx.ann—Person.
  • GeneralNMHumanTopView_v0.8GPU_onnx.ann—Person (top-down view).

Starting with DetectorPack 3.11, the following neural networks were added:

  • GeneralNMHumanAndVehicle_Nano_v1.0_GPU_onnx.ann—Person and vehicle (Nano).
  • GeneralNMHumanAndVehicle_Medium_v1.0_GPU_onnx.ann—Person and vehicle (Medium).
  • GeneralNMHumanAndVehicle_Large_v1.0_GPU_onnx.ann—Person and vehicle (Large).

Starting with DetectorPack 3.12, the following neural networks were added:

  • GeneralNMHumanTopView_Nano_v1.0_GPU_onnx.ann—Person (top-down view Nano).
  • GeneralNMHumanTopView_Medium_v1.0_GPU_onnx.ann—Person (top-down view Medium).
  • GeneralNMHumanTopView_Large_v1.0_GPU_onnx.ann—Person (top-down view Large).