# Windows Server Essential/Standard on Docker
### Windows Server 2019 Essential
試用版180天 產品金鑰:
>NJ3X8-YTJRF-3R9J9-D78MF-4YBP4
### Windows Server 2019 Standard
評估版180天 直接下載iso安裝即可
*Setting admin password(標點符號&&英文大小寫required)*
---
## Docker on Windows Server 2019
### Docker Desktop for Windows
![](https://i.imgur.com/WOQEtJg.png)
直接安裝即可 內建可以一鍵安裝/開啟k8s
System Requirements:
:::spoiler
* Windows 10 64-bit: Pro, Enterprise, or Education (Build 16299 or later).
For Windows 10 Home, see Install Docker Desktop on Windows Home.
* Hyper-V and Containers Windows features must be enabled.
* The following hardware prerequisites are required to successfully run Client Hyper-V on Windows 10:
* 64 bit processor with Second Level Address Translation (SLAT)
* 4GB system RAM
* BIOS-level hardware virtualization support must be enabled in the BIOS settings
:::
### 使用 OneGet 提供者 PowerShell 模組安裝 Docker(Docker for Windows Server)
https://github.com/OneGet/MicrosoftDockerProvider
![](https://i.imgur.com/qbGVoxA.png)
:::danger
*<< Essential版不可行 缺乏Windows Container Feature >>*
:::
![](https://i.imgur.com/VUnRvlr.png)
先到Server Manager > Dashboard > Add roles and features
點選到Features時勾選 Containers
接著會開始install 然後Restart-Computer
#### 安裝 OneGet PowerShell 模組
```
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
```
#### 安裝 OneGet docker provider
```
Import-Module -Name DockerMsftProvider -Force
Import-Packageprovider -Name DockerMsftProvider -Force
```
#### Install Docker
Upgrade to the latest version of docker:
```
Install-Package -Name docker -ProviderName DockerMsftProvider -Verbose -Update
```
---
## Local Environment for Tensorflow GPU
### Software/Hardware Requirements
(照順序安裝)
- TESLA DRIVER FOR WINDOWS
![](https://i.imgur.com/x0kgmCn.png)
:::spoiler
> Version: 451.48 WHQL
Release Date: 2020.7.7
Operating System: Windows Server 2016, Windows Server 2019
CUDA Toolkit: 11.0
Language: English (US)
File Size: 380.8 MB
:::
- Visual Studio Community 2019-16.6.4
![](https://i.imgur.com/NZGZtFV.png)
:::danger
記得在Workloads時要選擇Desktop development with C++
:::
- CUDA Toolkit 10.2/11.2
:::spoiler
>Operating System: Windows
Architecture: x86_64
Version: Server 2019
:::
- cuDNN (NVIDIA Developer Program Membership Required)
![](https://i.imgur.com/YYpC0Wx.png)
:::spoiler
>Download cuDNN v7.6.5 (November 18th, 2019), for CUDA 10.2
Library for Windows, Mac, Linux, Ubuntu and RedHat/Centos(x86_64architecture
cuDNN Library for Windows 10
:::
下載回cuDNN是一個壓縮檔案
解壓縮後把裡面三個資料夾的東西複製到C:/Program Files/NVIDIA GPU Computin Toolkit/CUDA/v(版本)/
相對應的地方
![](https://i.imgur.com/FgNsXjz.png)
#### nvidia-smi register to PATH
control panel > System and Security > System > Advanced system settings > Advanced > Environment Variables > User variables for Administor > Double Click Path > New: C:\Program Files\NVIDIA Corporation\NVSMI
```
> cmd
nvidia-smi
```
for checking gpu condition immediately
:::warning
*docker裡用nvidia-smi測不到gpu
:::
- Anaconda3-2020.02 Windows x86_64
*測試時 用python3.5跑不起來
改用python3.7就成功*
:::spoiler
> tensorflow-gpu v2.1.0
python v3.7.6final.0
conda v4.8.3
:::
### conda env command for tensorflow gpu
```python
conda create -n tensorflow-gpu pip python=3.7
```
```python
activate tensorflow-gpu
```
```python
pip install tensorflow-gpu
```
```python
conda install -c anaconda ipykernel
```