01 Jan 2000
Home  »    »   Bootstrap Installation Procedure Of Linux

Bootstrap Installation Procedure Of Linux

Posted in HomeBy adminOn 20/01/18

CNTK Production Build and Test configuration CNTK may be successfully run in many Linux configurations, but in case you want to avoid possible compatibility issues you may get yourself familiar with where we list all dependency component and component versions that we use. CNTK as a Docker container Before moving any further you may consider deploying CNTK as a Docker container.

For first time Arch users who want an even easier Arch set up than the chroot from an existing Linux installation should try Manjaro over this method or Antergos. Brook @ V570-MANJARO ~ └─ $ ▷curl -O.

Bootstrap Installation Procedure Of Linux

Current limitations and precautions Please, read carefully this section before you proceed with your system configuration. The information below may save you a lot of time otherwise spent on build errors debugging.

Note This page assumes that you are trying to build CNTK's master branch. Expected component locations in configure and Makefile scripts Today configure and Makefile scripts support only limited set of installation paths for all dependency components listed in this section. We know, that this is a limitation and will fix it soon (also if you feel like improving these scripts yourselves and your help is welcome and much appreciated).

Configure looks for all dependency components among the paths listed in default_path_list variable defined within the script. Important If you want to modify default_path_list variable in configure to add a custom path for a certain dependency component be sure to check the correspondent section of Makefile. Otherwise you may get build errors due to inability of finding INCLUDE files, libraries, etc. Installation methods and paths of dependency components Below we list all dependency components required to build CNTK and explain how to install them. We understand that there are many other ways to get the same components. Ricettario Bimby Ebook Store. However, if you prefer an alternative way of installation, please ensure that you get the same thing, because quite often alternative installation sources, namely network distribution packages (like Debian, RPM, etc.) contain older versions of the software, miss some libraries, etc.

In some sections below we specifically highlight these limitations, but please take it as a general precaution. Usage of make -j In most of the sections we suggest using make -j command to invoke parallel build jobs and thus increasing the speed of the build process. However please be aware that on some systems and especially on virtual machines using make -j may result in 'Out of memory' errors. If you face this, just use 'plain' make or limit the number of jobs that run simultaneously (two simultaneous jobs usually work for the most of the systems - use the command make -j 2). Simultaneous installation of different versions of the same development packages Be very careful in case you would like to have several installations of some of the development packages mentioned below on the same system. It may result in very hard to debug build errors as you can see in. And now let's proceed to the setup.

If you would like to know what prerequisite configuration is used in the CNTK production environment, i.e. What we use internally for building and testing, see 64-bit OS You need a 64-bit Linux installation to use CNTK.

C++ Compiler Ensure your installation has a C++ compiler. Many distributions do not include it by default. Refer to your platform documentation on how to check for and obtain a C++ compiler. Example: for Ubuntu, run the following command: dpkg --list grep compiler if in the output you do not see something like g++-4.8 4.8.4-2ubuntu1~14.04 amd64 GNU C++ compiler then a C++ compiler is not installed.

If you have Ubuntu 1404, install gcc 4.8 with: sudo apt-get install g++ If you have Ubuntu 1604 or something else, install gcc 4.8 by following: Git Install Git on your system as described. MKL The default CNTK math library is the. CNTK supports using the Intel MKL via a custom library version. Installing the MKLML library: • Create a directory on your machine to hold MKLML, e.g.: sudo mkdir /usr/local/mklml • Download the required MKLML v0.11 from the. Un-tar it into your MKLML path, creating a versioned sub directory within. Sudo wget sudo tar -xzf mklml_lnx_2018.0.1.20171007.tgz -C /usr/local/mklml Note: if you want to build with different MKLML versions, • When configuring the build (cf. Below), specify the option --with-mkl or --with-mkl=, e.g., --with-mkl=/usr/local/mkl/.

Open MPI Install. We recommend installing from sources as described below because a lot of distribution packages contain older versions and miss the libraries required by CNTK. Current CNTK Open MPI version requirement is at least 1.10. Please, check whether you have older version installations on your system and if you do, either uninstall them or ensure (via, e.g.

Symbolic links) that CNTK build procedure is using the required version. Otherwise you may get hard to debug build errors as you can see in.

• Get the installation sources: wget • Unpack, build and install Open MPI (to /usr/local/mpi in this example): tar -xzvf./openmpi-1.10.3.tar.gz cd openmpi-1.10.3./configure --prefix=/usr/local/mpi make -j all sudo make install • Add the following environment variable to your current session and your.bashrc profile (Prepending the new path, ensures this version is used as opposed to a default version available through the OS): export PATH=/usr/local/mpi/bin:$PATH export LD_LIBRARY_PATH=/usr/local/mpi/lib:$LD_LIBRARY_PATH Protobuf We use Protocol Buffers for serialization. For installation please follow these steps: • Install the required packages using sudo apt-get install autoconf automake libtool curl make g++ unzip • Download and unpack protobuf sources wget tar -xzf v3.1.0.tar.gz • Compile protobuf cd protobuf-3.1.0./autogen.sh./configure CFLAGS=-fPIC CXXFLAGS=-fPIC --disable-shared --prefix=/usr/local/protobuf-3.1.0 make -j $(nproc) sudo make install ZLIB zlib today is a part of many popular Linux distributions so with the high probability you have it preinstalled. However note, that libzip requires zlib version 1.1.2 or later and this usually is NOT preinstalled. Zlib must be installed before building Boost below. See your platform documentation on how to get the required zlib package or get it directly from. Example: for Ubuntu use the following command: sudo apt-get install zlib1g-dev LIBZIP libzip is available in different network distribution packages, but we found that many of them contain old versions. Using these versions will likely result in build errors.

So we strongly recommend to build libzip from sources as described below. Note that the following procedure will install libzip to /usr/local. This is exactly where CNTK build procedure expects it (see for details). If you want to install libzip to a different path see instructions in INSTALL file in the root of libzip distribution folder. However beware that in this case you have to manually edit configure AND Makefile of CNTK to support this path. Use the following commands: wget tar -xzvf./libzip-1.1.2.tar.gz cd libzip-1.1.2./configure make -j all sudo make install Add the following environment variable to your current session and your.bashrc profile: export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH Boost Library The is a prerequisite for building the Microsoft Cognitive Toolkit. Follow these steps to install the Boost Library on your system: sudo apt-get install libbz2-dev sudo apt-get install python-dev wget -q -O - tar -xzf - cd boost_1_60_0./bootstrap.sh --prefix=/usr/local/boost-1.60.0 sudo./b2 -d0 -j'$(nproc)' install GPU Specific Packages This section outlines the packages you need to setup in order for CNTK to leverage GPUs.

If you do NOT intend to use any GPUs with CNTK and will rely on the CPU only, you may skip directly to the. Otherwise proceed further. Checking your GPU compatibility and getting the latest driver You need a -compatible graphic card available to use CNTK GPU capabilities. You can check whether your card is CUDA-compatible and. Your GPU card must be 3.0 or more.

If you have the required card, install the latest driver: • Select your card and download the driver pack from (usually available as.run file) • If your X Windows manager is running, the driver installation will likely fail. Open a remote terminal session to your machine and stop the X Windows manager. Refer to your platform documentation for the exact commands.

Example: for Ubuntu, use the following command (assuming lightdm is your X Windows manager): sudo stop lightdm • Install the driver as in the example below (note that the file name may be different for your system): sudo chmod +x./NVIDIA-Linux-x86_64-367.55.run sudo./NVIDIA-Linux-x86_64-367.55.run We recommend accepting the default installation options Note that the driver installation program may complain about nouveau kernel driver. Refer to your platform documentation for instructions for disabling it. For Ubuntu you may use. • If stopped during the steps above, start X Windows manager.

Refer to your platform documentation for the exact commands. Example: for Ubuntu, use the following command (in case of lightdm as your X Windows manager): sudo start lightdm CUDA 8 The procedure below explains how to install CUDA using.run file distribution. You can also use DEB or RPM packages installation. You will find the package for your system at and installation instructions in. Download and install the NVIDIA CUDA 8.0 Toolkit: • Find the.run file for your platform and download it.

• If your X Windows manager is running, the installation will likely fail. Open a remote terminal session to your machine and stop the X Windows manager. An Introduction To Syntax Van Valin Pdf Free. Refer to your platform documentation for the exact commands.

Example: for Ubuntu use the following command (in case of lightdm as your X Windows manager): sudo stop lightdm • Install the CUDA 8.0 Toolkit (note that the.run file name may be different for your system): chmod +x./cuda_8.0.44_linux.run sudo./cuda_8.0.44_linux.run When prompted by the installer: Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 367.48? (y)es/(n)o/(q)uit: Select no if you have already installed the latest driver by performing the steps in the. If you have not done it, select yes, but we strongly recommend updating to the latest driver after installing CUDA toolkit. If you declined the driver installation from the CUDA 8.0 package, you will get the following warning at the end of the installation: ***WARNING: Incomplete installation!

This installation did not install the CUDA Driver. A driver of version at least 361.00 is required for CUDA 8.0 functionality to work. To install the driver using this installer, run the following command, replacing with the name of this run file: sudo.run -silent -driver Ignore this warning. If stopped during the steps above, start X Windows manager.

Refer to your platform documentation for exact commands. Example: for Ubuntu use the following command (in case of lightdm as your X Windows manager): sudo start lightdm Add the following environment variable to your current session and your.bashrc profile (if you modified the default paths during the CUDA installation, change the values below accordingly): export PATH=/usr/local/cuda-8.0/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH The next step is optional. You may skip further to the.

Verifying CUDA 8.0 installation You may verify your CUDA installation by compiling the CUDA samples (we assume the default paths were used during the CUDA installation). Note that building all samples is a lengthy operation: cd ~/NVIDIA_CUDA-8.0_Samples/ make After the successful build invoke deviceQuery utility: ~/NVIDIA_CUDA-8.0_Samples/1_Utilities/deviceQuery/deviceQuery If everything works well, you should get an output similar to the one below:./deviceQuery Starting. Important Install cuDNN using the exact version and target path as specified below. This is necessary because it is expected by the CNTK build configuration program. • Use the following commands: wget tar -xzvf./cudnn-8.0-linux-x64-v6.0.tgz sudo mkdir /usr/local/cudnn-6.0 sudo cp -r cuda /usr/local/cudnn-6.0 • Add the following environment variable to your current session and your.bashrc profile: export LD_LIBRARY_PATH=/usr/local/cudnn-6.0/cuda/lib64:$LD_LIBRARY_PATH OPTIONAL. NCCL provides optimized primitives for collective multi-GPU communication on Linux.

CNTK can take advantage of these accelerated primitives for parallel jobs running on a single host (cf. For an introduction into parallel training with CNTK). Please follow instructions to download the NVIDIA NCCL library. Then, use the CNTK configure option --with-nccl= to enable building with NVIDIA NCCL. For example, if NCCL are installed in folder other than the default folder /usr, use configure --with-nccl= (plus additional options) to build with NVIDIA NCCL support.

Note Currently, CNTK's support for NVIDIA NCCL is limited to data-parallel SGD with 32/64 gradient bits, using the CNTK binary. Support for additional parallelization methods and CNTK v2 will be added in the future. The official release of CNTK is built with NCCL enabled. All linux Python wheels already include NCCL binary.

For Brainscript users on Linux, NCCL needs to be installed. If user prefers to not use NCCL, please build CNTK from source. Note that configure automatically detects NCCL installed under /usr, so please uninstall NCCL before build. This completes GPU Specific section OPTIONAL. If you want to take advantage of CNTK from Python, you will need to install. SWIG is also a requirement to build the CNTK Evaluation libraries for Java. To install it, run the script: [CNTK clone root]/Tools/devInstall/Linux/install-swig.sh.

This creates the installed version in the folder /usr/local/swig-3.0.10. CNTK v2 Python support This section describes how to build CNTK v2 with Python support. Step 1: Build Python APIs • Install the if you have not done so yet. Note In contrast to the setup shown for the Pip package installation, here we will load the CNTK module from the CNTK repository clone, not as an installed package in your Python environment. (Hence also the difference in setting up PYTHONPATH) Step 4: Verify setup Python • Run the Python examples from inside the [CNTK clone root]/Tutorials or [CNTK clone root]/Examples directories, to verify your installation. For example, go to the folder [CNTK clone root]/Tutorials/NumpyInterop and run python FeedForwardNet.py.

You should see the following output on the console: Minibatch: 0, Train Loss: 0.691407, Train Evaluation Criterion: 0.48 Minibatch: 20, Train Loss: 0.286133, Train Evaluation Criterion: 0.48 Minibatch: 40, Train Loss: 1.003906, Train Evaluation Criterion: 0.64 Minibatch: 60, Train Loss: 0.720704, Train Evaluation Criterion: 0.56 OPTIONAL. OpenCV CNTK 2.2 requires to be installed but it is optional for CNTK 2.3. You need to install OpenCV for CNTK 2.3, if you want to build any of the the following: • CNTK Image Reader • CNTK Image Writer - required to use Tensorboard's Image feature. If you plan to use both CUDA and OpenCV, OpenCV can have many interfaces and options. In this section we cover only parts necessary to build CNTK. Read more about installing OpenCV and more generally.

Important Install OpenCV using the exact version and target path as specified below. This is necessary because it is expected by the CNTK build configuration program. • Install OpenCV prerequisites.

See for the full package list and explanations. See your platform documentation on how to install the packages. Example: for Ubuntu use the following command: sudo apt-get install cmake libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev • Get OpenCV and install it. Use the following commands: wget unzip 3.1.0.zip cd opencv-3.1.0 mkdir release cd release cmake -D WITH_CUDA=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/opencv-3.1.0.

Make all sudo make install Note that in the instructions above we suggest using 'plain' make rather than make -j. We found that using make -j with OpenCV results in unstable system behavior and may result in a build failure and system crash.

Java To build the Java bindings for the CNTK Evaluation library, install the if you have not done so yet. Also, a Java Development Kit (JDK) is required. Currently we use 64-bit. The configure script provides --with-jdk option to specify the JDK directory manually, if it cannot be found by default.

Getting CNTK Source code Before proceeding further, please note, that if you plan on making modifications to the CNTK code you should read the information on. Use to clone the CNTK Repository and access the source code: git clone cd cntk git submodule update --init -- Source/Multiverso Submodule Multiverso is used for enable for training.

Optional If you don't need DataParallelASGD support, then pass the option --asgd=no to the configure command. Important The procedure above does not provide you with the access to 1-bit Stochastic Gradient Descent (1bit-SGD) and components. If you want to build CNTK with this functionality enabled, please read the instructions on and then proceed with the installation. Building CNTK To build CNTK use the following commands (we assume that the CNTK repository was cloned to ~/Repos/cntk): cd ~/Repos/cntk mkdir build/release -p cd build/release././configure Ensure that the configure output corresponds to the packages you installed in the previous sections. Ensure that configure finds CUDA if installed, etc. Do the following to build CNTK using all cores to minimize build time.

Note that on some computer, this can overwhelm your system leading to hangs or breaks during the build. Make -j all If the above overwhelms your computer, try specifying fewer cores. For example if you have more than 2 cores, and would like to keep 2 cores free from the build, you can try: make -j'$(($(nproc) - 2))' all If you want to be absolutely safe, just use 1 core: make all This should produce a release build of CNTK. In case you would like to get a debug build use the following parameter when invoking configure:././configure --with-buildtype=debug Quick test of CNTK build functionality To ensure that CNTK is working properly in your system, you can quickly run an example from the tutorial. This example trains a simple network and can be directed to use either CPU or GPU, which helps quickly ensure that CNTK is functioning properly.

Below we assume that the CNTK repository is cloned to ~/Repos/cntk and build/release was used as a sub-directory for the build. • Provide the path to the CNTK binaries and change to the Tutorials/HelloWorld-LogisticRegression directory: export PATH=$HOME/Repos/cntk/build/release/bin:$PATH cd ~/Repos/cntk/Tutorials/HelloWorld-LogisticRegression First try the example: cntk configFile=lr_bs.cntk makeMode=false If the sample runs, i.e., if there are no error messages, you will get output related first to reading the configuration, followed by the output of the actual network training. Trying CNTK with GPU If you built CNTK for GPU usage, try using the GPU by executing the following commands: cntk configFile=lr_bs.cntk makeMode=false deviceId=auto Near the beginning of the output you should see a line confirming a GPU was used: Model has 9 nodes. Note that GPU ID may be different. The deviceId parameter defines what processor to use for computation. • deviceId=-1 means use CPU.

Default value • deviceId=X where X is an integer >=0 means use GPU X, i.e. DeviceId=0 means GPU 0, etc. • deviceId=auto means use GPU, select GPU automatically Contributing to CNTK code If you plan modifications to the code you should read the information on. Next steps • • • •.