---
# System prepended metadata

title: Building environment
tags: [ML]

---

# Building environment
###### tags: `ML`

## Displaying Basic System Information on Linux Shell
using **`uanme`** command with `-a` return all system information.
```
$ uname -a
```

Get Machine Hardware Architecture
```shell
$ uname --m
ppc64le
```

Get Operation System Information
```shell
$ uname -o
GNU/Linux
```

Get Linux kernal version
```shell
$ uname -r
4.4.0-142-generic ppc64le
```

Type any one of the following command to find os name and version in Linux:
```shell
$ cat /etc/os-release
$ lsb_release -a
$ hostnamectl
``` 

## CUDA

安裝時須注意的幾個問題
- CUDA版本是否支援cuDNN版本
- cuDNN版本是否支援tensorflow版本
- nvidia driver環境變數路徑是否有設定正確
- CUDA路徑是否有設定正確

Check CUDA version
```
$ nvcc --version
```

**To check installation of CUDA, run below command**, if it’s installed properly then below command will not throw any error and will print correct version of library.
```
function lib_installed() { /sbin/ldconfig -N -v $(sed 's/:/ /' <<< $LD_LIBRARY_PATH) 2>/dev/null | grep $1; }
function check() { lib_installed $1 && echo "$1 is installed" || echo "ERROR: $1 is NOT installed"; }
check libcuda
check libcudart
```


## cuDNN Installation
NVDIA cuDNN is a GPU-accelerated library of primitives for deep neural networks.

Download the coresponding cuDNN on [cuDNN archive](https://developer.nvidia.com/rdp/cudnn-archive). After download, follow the **installation guide** from [NVDIA SDK Document](https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html) 


**To check installation of CuDNN, run below command**, if CuDNN is installed properly then you will not get any error.
```
function lib_installed() { /sbin/ldconfig -N -v $(sed 's/:/ /' <<< $LD_LIBRARY_PATH) 2>/dev/null | grep $1; }
function check() { lib_installed $1 && echo "$1 is installed" || echo "ERROR: $1 is NOT installed"; }
check libcudnn 
```

### Test Build Configuration

**GPU**

|Version|Python version	| Compiler | Build tools | cuDNN | CUDA |
| ----- | ------------- | -------- | ----------- | ----- | ---- |
|tensorflow-2.0.0 | 2.7, 3.3-3.7 | GCC 7.3.1 | Bazel 0.26.1 | 7.4 | 10.0 |
tensorflow_gpu-1.14.0 | 2.7, 3.3-3.7 | GCC 4.8 | Bazel 0.24.1 | 7.4 | 10.0 |
tensorflow_gpu-1.13.1 | 2.7, 3.3-3.7 | GCC 4.8 | Bazel 0.19.2 | 7.4 | 10.0 |
tensorflow_gpu-1.12.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.15.0 | 7 | 9 |
tensorflow_gpu-1.11.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.15.0 | 7 | 9 | 
tensorflow_gpu-1.10.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.15.0 | 7 | 9 |
tensorflow_gpu-1.9.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.11.0 | 7 | 9 |
tensorflow_gpu-1.8.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.10.0 | 7 | 9 |
tensorflow_gpu-1.7.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.9.0 | 7 | 9 |
tensorflow_gpu-1.6.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.9.0 | 7 | 9 |
tensorflow_gpu-1.5.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.8.0 | 7 | 9 |
tensorflow_gpu-1.4.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.5.4 | 6 | 8 |
tensorflow_gpu-1.3.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.4.5 | 6 | 8 |
tensorflow_gpu-1.2.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.4.5 | 5.1 | 8 |
tensorflow_gpu-1.1.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.4.2 | 5.1 | 8 |
tensorflow_gpu-1.0.0 | 2.7, 3.3-3.6 | GCC 4.8 | Bazel 0.4.2 | 5.1 | 8 |

> [Table refernece: Tensorflow build ](https://www.tensorflow.org/install/source#common_installation_problems)

## install docker


## Install Package



## Install tensorflow


```shell
$ conda install -c anaconda tensorflow-gpu
```
## 