You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/03/11 03:04:35 UTC

[GitHub] [incubator-mxnet] vexilligera opened a new pull request #17808: Windows dev environment configuration, update install instructions from source in the docs

vexilligera opened a new pull request #17808: Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808
 
 
   ## Description ##
   Taking over #17206 with fix to #17635
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) created (except PRs with tiny changes)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
   - [ ] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments are documented. 
   - For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
   - Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [ ] To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - [ ] Feature1, tests, (and when applicable, API doc)
   - [ ] Feature2, tests, (and when applicable, API doc)
   
   ## Comments ##
   - If this change is a backward incompatible change, why must this change be made.
   - Interesting edge cases to note here
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402716630
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -106,29 +129,37 @@ class BuildFlavour(Enum):
         '-DCMAKE_BUILD_TYPE=Release')
 
     , 'WIN_GPU': (
+        '-DCMAKE_C_COMPILER=cl '
+        '-DCMAKE_CXX_COMPILER=cl '
         '-DUSE_CUDA=ON '
         '-DUSE_CUDNN=ON '
         '-DENABLE_CUDA_RTC=ON '
         '-DUSE_OPENCV=ON  '
+        '-DOpenCV_RUNTIME=vc15 '
+        '-DOpenCV_ARCH=x64 '
         '-DUSE_OPENMP=ON '
         '-DUSE_BLAS=open '
         '-DUSE_LAPACK=ON '
         '-DUSE_DIST_KVSTORE=OFF '
-        '-DMXNET_CUDA_ARCH="5.2" '
+        '-DMXNET_CUDA_ARCH="7.5" '
 
 Review comment:
   Let's keep using g3 instances for now then.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-606545125
 
 
   Jenkins CI successfully triggered : [windows-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402526485
 
 

 ##########
 File path: CMakeLists.txt
 ##########
 @@ -163,6 +163,8 @@ if(MSVC)
   add_definitions(-DDMLC_STRICT_CXX11)
   add_definitions(-DNOMINMAX)
   set(CMAKE_C_FLAGS "/MP")
+  # report an accurate value for recent C++ language standards support
+  set(CMAKE_CXX_FLAGS "/Zc:__cplusplus")
 
 Review comment:
   @ChaiBapchya @vexilligera you added this line, but it doesn't have any effect as it is overwritte in the line below

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402716570
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -253,12 +284,8 @@ def main():
     system = platform.system()
     if system == 'Windows':
         logging.info("Detected Windows platform")
-        if 'OpenBLAS_HOME' not in os.environ:
-            os.environ["OpenBLAS_HOME"] = "C:\\Program Files\\OpenBLAS-v0.2.19"
-        if 'OpenCV_DIR' not in os.environ:
-            os.environ["OpenCV_DIR"] = "C:\\Program Files\\OpenCV-v3.4.1\\build"
         if 'CUDA_PATH' not in os.environ:
-            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2"
+            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2"
 
 Review comment:
   We agreed on using VS 2019. Cuda 10 is a requirement for using VS 2019

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r401361553
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -193,14 +238,19 @@ def windows_package(args):
         for dll in dlls:
             logging.info("packing dll: %s", dll)
             shutil.copy(dll, pkgdir_lib)
+
+        if pkgdir_lib.find('gpu') != -1:
+            add_path("C:\\jenkins_slave\\workspace\\ut-python-gpu\\windows_package\\lib")
 
 Review comment:
   That's right, forgot to remove that. Will add that to the testing phase once we got the log from ad95025

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-607576159
 
 
   @mxnet-bot run ci [windows-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605447906
 
 
   WIN_GPU_MKLDNN is having a flaky issue similar to https://github.com/pytorch/pytorch/issues/25393

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r397595002
 
 

 ##########
 File path: ci/windows_dev_env/windows_deps_headless_installer.py
 ##########
 @@ -0,0 +1,429 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+"""Dependency installer for Windows"""
+
+__author__ = 'Pedro Larroy, Chance Bair'
+__version__ = '0.2'
+
+import argparse
+import errno
+import logging
+import os
+import psutil
+import shutil
+import subprocess
+import urllib
+import stat
+import tempfile
+import zipfile
+from time import sleep
+from urllib.error import HTTPError
+import logging
+from subprocess import check_output, check_call, call
+import re
+import sys
+import urllib.request
+import contextlib
+
+import ssl
+
+ssl._create_default_https_context = ssl._create_unverified_context
+
+log = logging.getLogger(__name__)
+
+
+DEPS = {
+    'openblas': 'https://windows-post-install.s3-us-west-2.amazonaws.com/OpenBLAS-windows-v0_2_19.zip',
+    'opencv': 'https://windows-post-install.s3-us-west-2.amazonaws.com/opencv-windows-4.1.2-vc14_vc15.zip',
+    'cudnn': 'https://windows-post-install.s3-us-west-2.amazonaws.com/cudnn-9.2-windows10-x64-v7.4.2.24.zip',
+    'nvdriver': 'https://windows-post-install.s3-us-west-2.amazonaws.com/nvidia_display_drivers_398.75_server2016.zip',
 
 Review comment:
   I currently don't have access to windows-post-install, so I opened another bucket (mxnet-windows-build). It would be easy to merge them.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera removed a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera removed a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-606725758
 
 
   @ChaiBapchya I added instance type auto-detection and found out c5 was running the GPU ci, which caused the segfault.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r403117249
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -253,12 +284,8 @@ def main():
     system = platform.system()
     if system == 'Windows':
         logging.info("Detected Windows platform")
-        if 'OpenBLAS_HOME' not in os.environ:
-            os.environ["OpenBLAS_HOME"] = "C:\\Program Files\\OpenBLAS-v0.2.19"
-        if 'OpenCV_DIR' not in os.environ:
-            os.environ["OpenCV_DIR"] = "C:\\Program Files\\OpenCV-v3.4.1\\build"
         if 'CUDA_PATH' not in os.environ:
-            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2"
+            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2"
 
 Review comment:
   Are you sure about that? Usually visual studio can be upgraded by installing the vc++ toolset which then grants the possibility to compile other cuda versions. I'm not aware that this categorically excluded. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605897612
 
 
   > Test in WIN_GPU fail at
   > 
   > ```
   > OSError: [WinError 126] The specified module could not be found
   > ```
   > 
   > This one means the libmxnet.dll is not in the DLL Search path [acc to Stackoverflow]
   > Fix would be to add it into the environment
   > https://stackoverflow.com/questions/43987081/openslide-python-import-error
   > 
   > What's surprising is : libmxnet.dll & mxnet_70.dll are being packed into windows_package.7z and unpacked during test phase correctly.
   > While WIN_CPU tests don't give this error, WIN_GPU fails
   
   @larroy says he used to run into the problem and it was solved by packing opencv binary. In this case the opencv is already in the environment path and therefore be found. Although WinError 126 could also occur if a dependent dll is missing, in my local tests when I deliberately created that situation, segmentation fault (access violation at 0x0000000000000000) is thrown instead.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605550836
 
 
   @mxnet-bot run ci [windows-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605555389
 
 
   @marcoabreu Even in this case, @vexilligera is unable to reproduce the error locally. And Windows GPU + MKLDNN is flaky. How do you suggest we proceed trying to resolve the thrust issue?
   
   Fail : http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/13/pipeline
   Pass : http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/12/pipeline
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-600951836
 
 
   > @vexilligera what is the status of this PR?
   
   I'm trying to update the AMI to VS2019 and CUDA 10.2 and there's a bug with dmlc-core, probably caused by different MSVC standards. I'm working on that. If it's an issue with MSVC then I will try to use Clang-cl for building.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402551255
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -253,12 +284,8 @@ def main():
     system = platform.system()
     if system == 'Windows':
         logging.info("Detected Windows platform")
-        if 'OpenBLAS_HOME' not in os.environ:
-            os.environ["OpenBLAS_HOME"] = "C:\\Program Files\\OpenBLAS-v0.2.19"
-        if 'OpenCV_DIR' not in os.environ:
-            os.environ["OpenCV_DIR"] = "C:\\Program Files\\OpenCV-v3.4.1\\build"
         if 'CUDA_PATH' not in os.environ:
-            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2"
+            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2"
 
 Review comment:
   Same here

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r401038549
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -33,16 +33,43 @@
 import zipfile
 from distutils.dir_util import copy_tree
 from enum import Enum
-from subprocess import check_call
+from subprocess import check_call, call
+import urllib.request
 
 from util import *
 
+
+# Fix for broken PATH with newline inserted presumably by VS studio installation of SQL server or
+# other component which makes visual studio stop working.
+os.environ['PATH']=os.environ.get('PATH').replace('\n','')
+
 KNOWN_VCVARS = {
+    # https://gitlab.kitware.com/cmake/cmake/issues/18920
     'VS 2015': r'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat',
-    'VS 2017': r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsx86_amd64.bat'
+    'VS 2017': r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat',
+    'VS 2019': r'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat'
 }
 
 
+def get_cuda_arch(default='"5.2"'):
+    # cuda arch auto detection in cmake doesn't work on windows ci
 
 Review comment:
   The autodetection works fine on Windows. But we are compiling on a CPU instance, so of course you can't detect the gpu arch automatically. Can you remove this function and specify the MXNET_CUDA_ARCH argument as is done before? This function adds unnecessary complexity.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605749709
 
 
   >     1. Retries are fine for now, but must be removed before merging.
   
   With the CI blocked on windows-gpu for last 4 days and this PR trying to unblock the CI with an updated AMI, I guess it would be a good way to unblock the CI by allowing retries for now.
   I have created issue : https://github.com/apache/incubator-mxnet/issues/17935 for tracking this problem. 
   
   But for unblocking CI do you think it makes sense to add the retries as a temporary hotfix?
   @vexilligera tested the retries 10 times to see that adding retries safely ensures successful compilation all the time.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] marcoabreu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
marcoabreu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-606772939
 
 
   A missing dll might not mean that the dll itself is missing but that I can not be loaded to a miss in the dependency chain. I'd recommend to get the artifact and inspect it with some resources manager (similar to ldd). That should tell you which dependencies are expected and you can verify that they are available. 
   
   Maybe also starting with a debugger could help to see a more detailed exception which explains which dependency of the dll is missing. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605447906
 
 
   WIN_GPU_MKLDNN is having a flaky issue similar to https://github.com/pytorch/pytorch/issues/25393

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605545180
 
 
   Jenkins CI successfully triggered : [windows-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] aaronmarkham commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
aaronmarkham commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-597728044
 
 
   Let me know when this is ready, and I'll test it out.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605283539
 
 
   Turns out the path mentioned in ci/build_windows.py is correct
   ```
   VS 2019': r'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsx86_amd64.bat
   ```
   That is exactly where the bat file is.
   
   [verified this by launching an instance using the updated windows AMI]
   
   However, this path : "C:\jenkins_slave\workspace\build-cpu-mkldnn-mkl" doesn't exist on the AMI. Joe fixed It and updated AMI. testing on that.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-604250636
 
 
   Updated links for cudnn & VS2019 [private bucket: restricted access]
   - https://windows-post-install.s3-us-west-2.amazonaws.com/vs_community__1246179388.1585201415.exe
   - https://windows-post-install.s3-us-west-2.amazonaws.com/cudnn-10.2-windows10-x64-v7.6.5.32.zip

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605555389
 
 
   @marcoabreu Even in this case, @vexilligera is unable to reproduce the error locally. And Windows GPU + MKLDNN is flaky. How do you suggest we proceed trying to resolve the thrust issue on CI?
   
   Fail : http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/13/pipeline
   Pass : http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/12/pipeline
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] marcoabreu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
marcoabreu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-608055780
 
 
   Connectivity errors were never an issue with Windows slaves. It sounds like you've changed something as part of generating the AMIs. Thus, I'm hesitant to just accept a bunch of more changes (which have not been made transparent) as a result to fix a previously created issue.
   
   Please just revert stuff back to what it was and stop putting duckttape over things. The build used to work and the slaves used to be stable. But I have only seen attempts to change things but no rootcausing (I know about the 2GB limit). Some action resulted in our build breaking and the only sane choice is to revert whatever was done and then do these efforts again.
   
   I will not accept multiple layers of fixes which could have been avoided if the changes were properly developed and tested in a separate environment. At the moment, it seems like open heart surgery on a productive system. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-606364571
 
 
   > > The only dependent dll of libmxnet.dll is cudart64_102.dll (not including the win32 dlls). For mxnet_70.dll, the libraries of opencv and openblas are already in the ami's environment path.
   > 
   > There should be more dependent dlls? For example, if built with fusion support, the cuda driver should also be a dependent library? #17858
   > 
   > https://github.com/apache/incubator-mxnet/blob/56e79853ad5cf98baf84454eb595c7658bef6ee6/CMakeLists.txt#L613-L621
   
   They have fixed WinError 126 and now we are looking at a segfault

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605549604
 
 
   Jenkins CI successfully triggered : [unix-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera removed a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera removed a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605796656
 
 
   I printed the path to the missing dll and it was:
   C:\jenkins_slave\workspace\ut-python-gpu\windows_package\lib\libmxnet.dll
   However, the build log shows this is packed into windows_package as you can find here:
   http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/19/
   
   @larroy suggests packing the opencv binary as well but since opencv is already in the environment path of the AMI I guess the real problem should be something else (if opencv is missing and libmxnet.dll present you'll get segmentation fault instead, WinError 126 is triggered from Python due to wrong path)
   
   @marcoabreu do you have any suggestion on this?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-604739315
 
 
   @mxnet-bot run ci [windows-cpu, windows-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-607927187
 
 
   Jenkins CI successfully triggered : [windows-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-604250636
 
 
   Updated links for cudnn & VS2019 [private repo: restricted access]
   - https://windows-post-install.s3-us-west-2.amazonaws.com/vs_community__1246179388.1585201415.exe
   - https://windows-post-install.s3-us-west-2.amazonaws.com/cudnn-10.2-windows10-x64-v7.6.5.32.zip

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605244072
 
 
   It's failing only for windows-cpu MKLDNN MKL part with the error
   "can't find specified path"
   ```
   [2020-03-27T18:52:40.264Z] "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsx86_amd64.bat" && cmake -G Ninja -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DUSE_CUDA=OFF 
   [2020-03-27T18:52:40.264Z] -DUSE_CUDNN=OFF -DENABLE_CUDA_RTC=OFF -DUSE_OPENCV=ON -DOpenCV_RUNTIME=vc15 -DOpenCV_ARCH=x64 -DUSE_OPENMP=ON -DUSE_BLAS=mkl -DUSE_LAPACK=ON -DUSE_DIST_KVSTORE=OFF -DUSE_MKL_IF_AVAILABLE=ON 
   [2020-03-27T18:52:40.264Z] -DUSE_MKLDNN=ON -DCMAKE_BUILD_TYPE=Release C:\jenkins_slave\workspace\build-cpu-mkldnn-mkl
   ```
   
   @larroy is this related to path not being on oneline? or the path itself is incorrect?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605749709
 
 
   >     1. Retries are fine for now, but must be removed before merging.
   
   @marcoabreu 
   With the CI blocked on windows-gpu for last 4 days and this PR trying to unblock the CI with an updated AMI, I guess it would be a good way to unblock the CI by allowing retries for now.
   I have created issue : https://github.com/apache/incubator-mxnet/issues/17935 for tracking this problem. 
   
   But for unblocking CI do you think it makes sense to add the retries as a temporary hotfix?
   @vexilligera tested the retries 10 times to see that adding retries safely ensures successful compilation all the time.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-600951836
 
 
   > @vexilligera what is the status of this PR?
   
   I'm trying to update the AMI to VS2019 and CUDA 10.2 and there's a bug with dmlc-core, probably caused by different MSVC standards. I'm working on that.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-607061503
 
 
   @leezu seems like adding both 5.2 and 7.0 and then dropping 7.0 would trigger a normal run...but each run should be independent, right?
   See here: http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/44/
   
   With @josephevans 's fix + pip install I think the CI is working now. But we are getting some Jenkins issue.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605590914
 
 
   We can get rid of WIN_GPU_MKLDNN tests altogether but that still leaves us with the flakiness of WIN_GPU as can be seen in these builds
   For roughly same code of this PR & same windows AMI, below are the results so far
   
   WIN_GPU | WIN_GPU_MKLDNN | Build Number | Link
   -- | -- | -- | -- |
   ✖︎| ✔︎|15 | http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/15/pipeline
   ✖︎| ✔︎| 14 | http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/14/pipeline
   ✔︎|✔︎| 12 | http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/12/pipeline
   ✔︎| ✖︎| 13 | http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/13/pipeline
   
   Ofcourse your tests on local have a different story to tell...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402550424
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -106,29 +129,37 @@ class BuildFlavour(Enum):
         '-DCMAKE_BUILD_TYPE=Release')
 
     , 'WIN_GPU': (
+        '-DCMAKE_C_COMPILER=cl '
+        '-DCMAKE_CXX_COMPILER=cl '
         '-DUSE_CUDA=ON '
         '-DUSE_CUDNN=ON '
         '-DENABLE_CUDA_RTC=ON '
         '-DUSE_OPENCV=ON  '
+        '-DOpenCV_RUNTIME=vc15 '
+        '-DOpenCV_ARCH=x64 '
         '-DUSE_OPENMP=ON '
         '-DUSE_BLAS=open '
         '-DUSE_LAPACK=ON '
         '-DUSE_DIST_KVSTORE=OFF '
-        '-DMXNET_CUDA_ARCH="5.2" '
+        '-DMXNET_CUDA_ARCH="7.5" '
 
 Review comment:
   This change warrants further discussion. Please change it back.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402547355
 
 

 ##########
 File path: CMakeLists.txt
 ##########
 @@ -163,6 +163,8 @@ if(MSVC)
   add_definitions(-DDMLC_STRICT_CXX11)
   add_definitions(-DNOMINMAX)
   set(CMAKE_C_FLAGS "/MP")
+  # report an accurate value for recent C++ language standards support
+  set(CMAKE_CXX_FLAGS "/Zc:__cplusplus")
 
 Review comment:
   ```
   set(flag ${flag} "secondval")
   ``` 
   does append right?
   I thought we are appending to `CMAKE_CXX_FLAGS`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-606212722
 
 
   > The only dependent dll of libmxnet.dll is cudart64_102.dll (not including the win32 dlls). For mxnet_70.dll, the libraries of opencv and openblas are already in the ami's environment path.
   
   There should be more dependent dlls? For example, if built with fusion support, the cuda driver should also be a dependent library? https://github.com/apache/incubator-mxnet/issues/17858
   
   https://github.com/apache/incubator-mxnet/blob/56e79853ad5cf98baf84454eb595c7658bef6ee6/CMakeLists.txt#L613-L621

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-608067177
 
 
   Discussion continued at https://github.com/apache/incubator-mxnet/pull/17962#issuecomment-608066411

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605550842
 
 
   Jenkins CI successfully triggered : [windows-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605870227
 
 
   OSError: [WinError 126] The specified module could not be found
   
   This one means the libmxnet.dll is not in the DLL Search path [acc to Stackoverflow]
   Fix would be to add it into the environment
   https://stackoverflow.com/questions/43987081/openslide-python-import-error
   
   What's surprising is : libmxnet.dll & mxnet_70.dll are being packed into windows_package.7z and unpacked during test phase correctly.
   While WIN_CPU tests don't give this error, WIN_GPU fails

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r401968893
 
 

 ##########
 File path: ci/windows/test_py3_gpu.ps1
 ##########
 @@ -23,7 +23,20 @@ $env:MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
 $env:MXNET_SUBGRAPH_VERBOSE=0
 $env:MXNET_HOME=[io.path]::combine($PSScriptRoot, 'mxnet_home')
 
 
 Review comment:
   let's print all ENV Vars to compare state of env vars in CI run vs manual powershell test
   ```Get-ChildItem Env:```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-615001520
 
 
   Closing since this is now fixed in #17962 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-615013613
 
 
   @vexilligera it's not fixed. We need a script to generate the working AMI. https://github.com/apache/incubator-mxnet/pull/17962 is only a hotfix.
   
   Will you be working on the automated setup or is someone else taking over the work? Please clarify. Thank you

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r401047981
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -33,16 +33,43 @@
 import zipfile
 from distutils.dir_util import copy_tree
 from enum import Enum
-from subprocess import check_call
+from subprocess import check_call, call
+import urllib.request
 
 from util import *
 
+
+# Fix for broken PATH with newline inserted presumably by VS studio installation of SQL server or
+# other component which makes visual studio stop working.
+os.environ['PATH']=os.environ.get('PATH').replace('\n','')
+
 KNOWN_VCVARS = {
+    # https://gitlab.kitware.com/cmake/cmake/issues/18920
     'VS 2015': r'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat',
-    'VS 2017': r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsx86_amd64.bat'
+    'VS 2017': r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat',
+    'VS 2019': r'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat'
 }
 
 
+def get_cuda_arch(default='"5.2"'):
+    # cuda arch auto detection in cmake doesn't work on windows ci
 
 Review comment:
   Mistakenly added due to misconception, already removed. Sorry about this.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605897612
 
 
   > Test in WIN_GPU fail at
   > 
   > ```
   > OSError: [WinError 126] The specified module could not be found
   > ```
   > 
   > This one means the libmxnet.dll is not in the DLL Search path [acc to Stackoverflow]
   > Fix would be to add it into the environment
   > https://stackoverflow.com/questions/43987081/openslide-python-import-error
   > 
   > What's surprising is : libmxnet.dll & mxnet_70.dll are being packed into windows_package.7z and unpacked during test phase correctly.
   > While WIN_CPU tests don't give this error, WIN_GPU fails
   
   @larroy says he used to run into the problem and it was solved by packing opencv binary. In this case the opencv is already in the environment path and therefore be found. Although WinError 126 could also occur if a dependent dll is missing, in my local tests when I deliberately created that situation, segmentation fault (access violation at 0x0000000000000000) is thrown instead. 
   @larroy  also suggests using dependency walker to look at the dependent dlls. The only dependent dll of libmxnet.dll is cudart64_102.dll (not including the win32 dlls). For mxnet_70.dll, the libraries of opencv and openblas are already in the ami's environment path.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605602021
 
 
   @larroy do you have any idea on how to solve Win 126 on CI? Basically the binaries aren't in the search path and dlopen fails due to that

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-608023880
 
 
   @marcoabreu Do you still stand by your veto?
   
   > "Retries are fine for now, but must be removed before merging."
   
   I suggest to go ahead and merge this with the retries. We don't have control over the thrust + VS code incompatibility and may need to wait for a fix on nvidia's or microsoft's side. Doesn't seem worth to block all MXNet development until the bug in "thrust + VS code" is fixed, given it's an open issue affecting other projects as well: https://github.com/pytorch/pytorch/issues/25393

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-600929174
 
 
   @vexilligera what is the status of this PR?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r401049583
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -33,16 +33,43 @@
 import zipfile
 from distutils.dir_util import copy_tree
 from enum import Enum
-from subprocess import check_call
+from subprocess import check_call, call
+import urllib.request
 
 from util import *
 
+
+# Fix for broken PATH with newline inserted presumably by VS studio installation of SQL server or
+# other component which makes visual studio stop working.
+os.environ['PATH']=os.environ.get('PATH').replace('\n','')
+
 KNOWN_VCVARS = {
+    # https://gitlab.kitware.com/cmake/cmake/issues/18920
     'VS 2015': r'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat',
-    'VS 2017': r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsx86_amd64.bat'
+    'VS 2017': r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat',
+    'VS 2019': r'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat'
 }
 
 
+def get_cuda_arch(default='"5.2"'):
+    # cuda arch auto detection in cmake doesn't work on windows ci
 
 Review comment:
   No worries. Thanks for your work on this.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605870227
 
 
   Test in WIN_GPU fail at
   ```
   OSError: [WinError 126] The specified module could not be found
   ```
   This one means the libmxnet.dll is not in the DLL Search path [acc to Stackoverflow]
   Fix would be to add it into the environment
   https://stackoverflow.com/questions/43987081/openslide-python-import-error
   
   What's surprising is : libmxnet.dll & mxnet_70.dll are being packed into windows_package.7z and unpacked during test phase correctly.
   While WIN_CPU tests don't give this error, WIN_GPU fails

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605611140
 
 
   > Sorry but I don't believe that you are testing the development on a VM when this kind of commit is necessary.
   
   Was testing on another instance and made commits on another...manually copied the code and missed some parts...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605796656
 
 
   I printed the path to the missing dll and it was:
   C:\jenkins_slave\workspace\ut-python-gpu\windows_package\lib\libmxnet.dll
   However, the build log shows this is packed into windows_package as you can find here:
   http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/19/
   
   @larroy suggests packing the opencv binary as well but since opencv is already in the environment path of the AMI I guess the real problem should be something else (if opencv is missing and libmxnet.dll present you'll get segmentation fault instead, WinError 126 is triggered from Python due to wrong path)
   
   @marcoabreu do you have any suggestion on this?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r397594701
 
 

 ##########
 File path: docs/static_site/src/pages/get_started/windows_setup.md
 ##########
 @@ -137,126 +137,37 @@ Check the chart below for other options or refer to [PyPI for other MXNet pip pa
 
 ## Build from Source
 
-**IMPORTANT: It is recommended that you review the [build from source guide](build_from_source) first.** It describes many of the build options that come with MXNet in more detail. You may decide to install additional dependencies and modify your build flags after reviewing this material.
 
-We provide two primary options to build and install MXNet yourself using [Microsoft Visual Studio 2017](https://www.visualstudio.com/downloads/) or [Microsoft Visual Studio 2015](https://www.visualstudio.com/vs/older-downloads/).
+For automated setting up of developer environment in windows, use script bundle from the
+![ci/windows_dev_env](https://github.com/apache/incubator-mxnet/tree/master/ci/windows_dev_env/)
+folder. Copy to a local directory and execute:
 
-**NOTE:** Visual Studio 2017's compiler is `vc15`. This is not to be confused with Visual Studio 2015's compiler, `vc14`.
-
-You also have the option to install MXNet with MKL or MKL-DNN. In this case it is recommended that you refer to the [MKLDNN_README](https://mxnet.apache.org/api/python/docs/tutorials/performance/backend/mkldnn/mkldnn_readme.html).
-
-**Option 1: Build with Microsoft Visual Studio 2017 (VS2017)**
-
-To build and install MXNet yourself using [VS2017](https://www.visualstudio.com/downloads/), you need the following dependencies. You may try a newer version of a particular dependency, but please open a pull request or [issue](https://github.com/apache/incubator-mxnet/issues/new) to update this guide if a newer version is validated.
-
-1. Install or update VS2017.
-    - If [VS2017](https://www.visualstudio.com/downloads/) is not already installed, download and install it. You can download and install the free community edition.
-    - When prompted about installing Git, go ahead and install it.
-    - If VS2017 is already installed you will want to update it. Proceed to the next step to modify your installation. You will be given the opportunity to update VS2017 as well
-1. Follow the [instructions for opening the Visual Studio Installer](https://docs.microsoft.com/en-us/visualstudio/install/modify-visual-studio) to modify `Individual components`.
-1. Once in the Visual Studio Installer application, update as needed, then look for and check `VC++ 2017 version 15.4 v14.11 toolset`, and click `Modify`.
-1. Change the version of the Visual studio 2017 to v14.11 using the following command (by default the VS2017 is installed in the following path):
-```
-"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.11
-```
-1. Download and install [CMake](https://cmake.org/download) if it is not already installed. [CMake v3.12.2](https://cmake.org/files/v3.12/cmake-3.12.2-win64-x64.msi) has been tested with MXNet.
-1. Download and run the  [OpenCV](https://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.4.1/opencv-3.4.1-vc14_vc15.exe/download) package. There are more recent versions of OpenCV, so please create an issue/PR to update this info if you validate one of these later versions.
-1. This will unzip several files. You can place them in another directory if you wish. We will use `C:\utils`(```mkdir C:\utils```) as our default path.
-1. Set the environment variable `OpenCV_DIR` to point to the OpenCV build directory that you just unzipped. Start ```cmd``` and type `set OpenCV_DIR=C:\utils\opencv\build`.
-1. If you don’t have the Intel Math Kernel Library (MKL) installed, you can install it and follow the [MKLDNN_README](https://mxnet.apache.org/api/python/docs/tutorials/performance/backend/mkldnn/mkldnn_readme.html) from here, or you can use OpenBLAS. These instructions will assume you're using OpenBLAS.
-1. Download the [OpenBlas](https://sourceforge.net/projects/openblas/files/v0.2.19/OpenBLAS-v0.2.19-Win64-int32.zip/download) package. Later versions of OpenBLAS are available, but you would need to build from source. v0.2.19 is the most recent version that ships with binaries. Contributions of more recent binaries would be appreciated.
-1. Unzip the file, rename it to ```OpenBLAS``` and put it under `C:\utils`. You can place the unzipped files and folders in another directory if you wish.
-1. Set the environment variable `OpenBLAS_HOME` to point to the OpenBLAS directory that contains the `include` and `lib` directories and type `set OpenBLAS_HOME=C:\utils\OpenBLAS` on the command prompt(```cmd```).
-1. Download and install [CUDA](https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal). If you already had CUDA, then installed VS2017, you should reinstall CUDA now so that you get the CUDA toolkit components for VS2017 integration. Note that the latest CUDA version supported by MXNet is [9.2](https://developer.nvidia.com/cuda-92-download-archive). You might also want to find other CUDA verion on the [Legacy Releases](https://developer.nvidia.com/cuda-toolkit-archive).
-1. Download and install cuDNN. To get access to the download link, register as an NVIDIA community user. Then follow the [link](http://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#install-windows) to install the cuDNN and put those libraries into ```C:\cuda```.
-1. Download and install [git](https://git-for-windows.github.io/) if you haven't already.
-
-After you have installed all of the required dependencies, build the MXNet source code:
-
-1. Start ```cmd``` in windows.
-2. Download the MXNet source code from GitHub by using following command:
-```
-cd C:\
-git clone https://github.com/apache/incubator-mxnet.git --recursive
-```
-3. Verify that the `DCUDNN_INCLUDE` and `DCUDNN_LIBRARY` environment variables are pointing to the `include` folder and `cudnn.lib` file of your CUDA installed location, and `C:\incubator-mxnet` is the location of the source code you just cloned in the previous step.
-4. Create a build dir using the following command and go to the directory, for example:
-```
-mkdir C:\incubator-mxnet\build
-cd C:\incubator-mxnet\build
-```
-5. Compile the MXNet source code with `cmake` by using following command:
 ```
-cmake -G "Visual Studio 15 2017 Win64" -T cuda=9.2,host=x64 -DUSE_CUDA=1 -DUSE_CUDNN=1 -DUSE_NVRTC=1 -DUSE_OPENCV=1 -DUSE_OPENMP=1 -DUSE_BLAS=open -DUSE_LAPACK=1 -DUSE_DIST_KVSTORE=0 -DCUDA_ARCH_LIST=Common -DCUDA_TOOLSET=9.2 -DCUDNN_INCLUDE=C:\cuda\include -DCUDNN_LIBRARY=C:\cuda\lib\x64\cudnn.lib "C:\incubator-mxnet"
+.\setup.ps1
 
 Review comment:
   Yes, we can explicitly use the cmd command invoked from ci/build_windows.py

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-607061503
 
 
   @leezu seems like adding both 5.2 and 7.0 and then dropping 7.0 would trigger a normal run...
   See here: http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/44/
   
   With @josephevans 's fix I think the CI is working now.
   Update: still runs into segfault...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-607927101
 
 
   @mxnet-bot run ci [windows-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-608020718
 
 
   Connectivity errors appear fixed now by switching to g4 (with faster cpu and network).
   
   Removed the debug statements and rebased on latest master.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r401038549
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -33,16 +33,43 @@
 import zipfile
 from distutils.dir_util import copy_tree
 from enum import Enum
-from subprocess import check_call
+from subprocess import check_call, call
+import urllib.request
 
 from util import *
 
+
+# Fix for broken PATH with newline inserted presumably by VS studio installation of SQL server or
+# other component which makes visual studio stop working.
+os.environ['PATH']=os.environ.get('PATH').replace('\n','')
+
 KNOWN_VCVARS = {
+    # https://gitlab.kitware.com/cmake/cmake/issues/18920
     'VS 2015': r'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat',
-    'VS 2017': r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsx86_amd64.bat'
+    'VS 2017': r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat',
+    'VS 2019': r'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat'
 }
 
 
+def get_cuda_arch(default='"5.2"'):
+    # cuda arch auto detection in cmake doesn't work on windows ci
 
 Review comment:
   The autodetection works fine on Windows. But we are compiling on a CPU instance. Can you remove this function and specify the MXNET_CUDA_ARCH argument as is done before? This function adds unnecessary complexity.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402552285
 
 

 ##########
 File path: ci/windows_dev_env/windows_deps_headless_installer.py
 ##########
 @@ -0,0 +1,397 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+"""Dependency installer for Windows"""
+
+__author__ = 'Pedro Larroy, Chance Bair'
+__version__ = '0.2'
+
+import argparse
+import errno
+import logging
+import os
+import psutil
+import shutil
+import subprocess
+import urllib
+import stat
+import tempfile
+import zipfile
+from time import sleep
+from urllib.error import HTTPError
+import logging
+from subprocess import check_output, check_call, call
+import re
+import sys
+import urllib.request
+import contextlib
+
+import ssl
+
+ssl._create_default_https_context = ssl._create_unverified_context
+
+log = logging.getLogger(__name__)
+
+
+DEPS = {
+    'openblas': 'https://windows-post-install.s3-us-west-2.amazonaws.com/OpenBLAS-windows-v0_2_19.zip',
+    'opencv': 'https://windows-post-install.s3-us-west-2.amazonaws.com/opencv-windows-4.1.2-vc14_vc15.zip',
+    'cudnn': 'https://windows-post-install.s3-us-west-2.amazonaws.com/cudnn-10.2-windows10-x64-v7.6.5.32.zip',
+    'nvdriver': 'https://windows-post-install.s3-us-west-2.amazonaws.com/nvidia_display_drivers_398.75_server2016.zip',
+    'perl': 'http://strawberryperl.com/download/5.30.1.1/strawberry-perl-5.30.1.1-64bit.msi',
+    'clang': 'https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/LLVM-9.0.1-win64.exe',
+    # This installation of CMake breaks windows PATH when executing vcvars, installing from
+    # chocolatey from powershell instead.
+    'cmake': 'https://github.com/Kitware/CMake/releases/download/v3.16.2/cmake-3.16.2-win64-x64.msi'
+}
+
+DEFAULT_SUBPROCESS_TIMEOUT = 3600
+
+
+@contextlib.contextmanager
+def remember_cwd():
+    '''
+    Restore current directory when exiting context
+    '''
+    curdir = os.getcwd()
+    try:
+        yield
+    finally:
+        os.chdir(curdir)
+
+
+def retry(target_exception, tries=4, delay_s=1, backoff=2):
+    """Retry calling the decorated function using an exponential backoff.
+
+    http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/
+    original from: http://wiki.python.org/moin/PythonDecoratorLibrary#Retry
+
+    :param target_exception: the exception to check. may be a tuple of
+        exceptions to check
+    :type target_exception: Exception or tuple
+    :param tries: number of times to try (not retry) before giving up
+    :type tries: int
+    :param delay_s: initial delay between retries in seconds
+    :type delay_s: int
+    :param backoff: backoff multiplier e.g. value of 2 will double the delay
+        each retry
+    :type backoff: int
+    """
+    import time
+    from functools import wraps
+
+    def decorated_retry(f):
+        @wraps(f)
+        def f_retry(*args, **kwargs):
+            mtries, mdelay = tries, delay_s
+            while mtries > 1:
+                try:
+                    return f(*args, **kwargs)
+                except target_exception as e:
+                    logging.warning("Exception: %s, Retrying in %d seconds...", str(e), mdelay)
+                    time.sleep(mdelay)
+                    mtries -= 1
+                    mdelay *= backoff
+            return f(*args, **kwargs)
+
+        return f_retry  # true decorator
+
+    return decorated_retry
+
+
+@retry((ValueError, OSError, HTTPError), tries=5, delay_s=2, backoff=5)
+def download(url, dest=None, progress=False) -> str:
+    from urllib.request import urlopen
+    from urllib.parse import (urlparse, urlunparse)
+    import progressbar
+    import http.client
+
+    class ProgressCB():
+        def __init__(self):
+            self.pbar = None
+
+        def __call__(self, block_num, block_size, total_size):
+            if not self.pbar and total_size > 0:
+                self.pbar = progressbar.bar.ProgressBar(max_value=total_size)
+            downloaded = block_num * block_size
+            if self.pbar:
+                if downloaded < total_size:
+                    self.pbar.update(downloaded)
+                else:
+                    self.pbar.finish()
+    if dest and os.path.isdir(dest):
+        local_file = os.path.split(urlparse(url).path)[1]
+        local_path = os.path.normpath(os.path.join(dest, local_file))
+    else:
+        local_path = dest
+    with urlopen(url) as c:
+        content_length = c.getheader('content-length')
+        length = int(content_length) if content_length and isinstance(c, http.client.HTTPResponse) else None
+        if length and local_path and os.path.exists(local_path) and os.stat(local_path).st_size == length:
+            log.debug(f"download('{url}'): Already downloaded.")
+            return local_path
+    log.debug(f"download({url}, {local_path}): downloading {length} bytes")
+    if local_path:
+        with tempfile.NamedTemporaryFile(delete=False) as tmpfd:
+            urllib.request.urlretrieve(url, filename=tmpfd.name, reporthook=ProgressCB() if progress else None)
+            shutil.move(tmpfd.name, local_path)
+    else:
+        (local_path, _) = urllib.request.urlretrieve(url, reporthook=ProgressCB())
+    log.debug(f"download({url}, {local_path}'): done.")
+    return local_path
+
+
+# Takes arguments and runs command on host.  Shell is disabled by default.
+# TODO: Move timeout to args
+def run_command(*args, shell=False, timeout=DEFAULT_SUBPROCESS_TIMEOUT, **kwargs):
+    try:
+        logging.info("Issuing command: {}".format(args))
+        res = subprocess.check_output(*args, shell=shell, timeout=timeout).decode("utf-8").replace("\r\n", "\n")
+        logging.info("Output: {}".format(res))
+    except subprocess.CalledProcessError as e:
+        raise RuntimeError("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
+    return res
+
+
+# Copies source directory recursively to destination.
+def copy(src, dest):
+    try:
+        shutil.copytree(src, dest)
+        logging.info("Moved {} to {}".format(src, dest))
+    except OSError as e:
+        # If the error was caused because the source wasn't a directory
+        if e.errno == errno.ENOTDIR:
+            shutil.copy(src, dest)
+            logging.info("Moved {} to {}".format(src, dest))
+        else:
+            raise RuntimeError("copy return with error: {}".format(e))
+
+
+# Workaround for windows readonly attribute error
+def on_rm_error(func, path, exc_info):
+    # path contains the path of the file that couldn't be removed
+    # let's just assume that it's read-only and unlink it.
+    os.chmod(path, stat.S_IWRITE)
+    os.unlink(path)
+
+
+def install_vs():
+    # Visual Studio 2019
+    # Components: https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2019#visual-studio-core-editor-included-with-visual-studio-community-2019
+    logging.info("Installing Visual Studio 2019...")
+    vs_file_path = download('https://windows-post-install.s3-us-west-2.amazonaws.com/vs_community__1246179388.1585201415.exe')
+    run_command("PowerShell Rename-Item -Path {} -NewName \"{}.exe\"".format(vs_file_path,
+                                                                             vs_file_path.split('\\')[-1]), shell=True)
+    vs_file_path = vs_file_path + '.exe'
+    ret = call(vs_file_path +
+               ' --add Microsoft.VisualStudio.Workload.ManagedDesktop'
+               ' --add Microsoft.VisualStudio.Workload.NetCoreTools'
+               ' --add Microsoft.VisualStudio.Workload.NetWeb'
+               ' --add Microsoft.VisualStudio.Workload.Node'
+               ' --add Microsoft.VisualStudio.Workload.Office'
+               ' --add Microsoft.VisualStudio.Component.TypeScript.2.0'
+               ' --add Microsoft.VisualStudio.Component.TestTools.WebLoadTest'
+               ' --add Component.GitHub.VisualStudio'
+               ' --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core'
+               ' --add Microsoft.VisualStudio.Component.Static.Analysis.Tools'
+               ' --add Microsoft.VisualStudio.Component.VC.CMake.Project'
+               ' --add Microsoft.VisualStudio.Component.VC.140'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.18362.Desktop'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.18362.UWP'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.18362.UWP.Native'
+               ' --add Microsoft.VisualStudio.ComponentGroup.Windows10SDK.18362'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.16299'
+               ' --wait'
+               ' --passive'
+               ' --norestart'
+               )
+
+    if ret == 3010 or ret == 0:
+        # 3010 is restart required
+        logging.info("VS install successful.")
+    else:
+        raise RuntimeError("VS failed to install, exit status {}".format(ret))
+    # Workaround for --wait sometimes ignoring the subprocesses doing component installs
+
+    def vs_still_installing():
+        return {'vs_installer.exe', 'vs_installershell.exe', 'vs_setup_bootstrapper.exe'} & set(map(lambda process: process.name(), psutil.process_iter()))
+    timer = 0
+    while vs_still_installing() and timer < DEFAULT_SUBPROCESS_TIMEOUT:
+        logging.warning("VS installers still running for %d s", timer)
+        if timer % 60 == 0:
+            logging.info("Waiting for Visual Studio to install for the last {} seconds".format(str(timer)))
+        sleep(1)
+        timer += 1
+    if vs_still_installing():
+        logging.warning("VS install still running after timeout (%d)", DEFAULT_SUBPROCESS_TIMEOUT)
+    else:
+        logging.info("Visual studio install complete.")
+
+
+def install_cmake():
+    logging.info("Installing CMAKE")
+    cmake_file_path = download(DEPS['cmake'], '.')
+    check_call(['msiexec ', '/n', '/passive', '/i', cmake_file_path])
+    logging.info("CMAKE install complete")
+
+
+def install_perl():
+    logging.info("Installing Perl")
+    with tempfile.TemporaryDirectory() as tmpdir:
+        perl_file_path = download(DEPS['perl'], tmpdir)
+        check_call(['msiexec ', '/n', '/passive', '/i', perl_file_path])
+    logging.info("Perl install complete")
+
+
+def install_clang():
+    logging.info("Installing Clang")
+    with tempfile.TemporaryDirectory() as tmpdir:
+        clang_file_path = download(DEPS['clang'], tmpdir)
+        run_command(clang_file_path + " /S /D=C:\\Program Files\\LLVM")
+    logging.info("Clang install complete")
+
+
+def install_openblas():
+    logging.info("Installing OpenBLAS")
+    local_file = download(DEPS['openblas'])
+    with zipfile.ZipFile(local_file, 'r') as zip:
+        zip.extractall("C:\\Program Files")
+    run_command("PowerShell Set-ItemProperty -path 'hklm:\\system\\currentcontrolset\\control\\session manager\\environment' -Name OpenBLAS_HOME -Value 'C:\\Program Files\\OpenBLAS-windows-v0_2_19'")
+    logging.info("Openblas Install complete")
+
+
+def install_mkl():
+    logging.info("Installing MKL 2019.3.203...")
+    file_path = download("http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15247/w_mkl_2019.3.203.exe")
 
 Review comment:
   Move links and similar things into constants

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605897612
 
 
   > Test in WIN_GPU fail at
   > 
   > ```
   > OSError: [WinError 126] The specified module could not be found
   > ```
   > 
   > This one means the libmxnet.dll is not in the DLL Search path [acc to Stackoverflow]
   > Fix would be to add it into the environment
   > https://stackoverflow.com/questions/43987081/openslide-python-import-error
   > 
   > What's surprising is : libmxnet.dll & mxnet_70.dll are being packed into windows_package.7z and unpacked during test phase correctly.
   > While WIN_CPU tests don't give this error, WIN_GPU fails
   
   @larroy says he used to run into the problem and it turned out that it was solved by packing opencv binary. In this case the opencv is already in the environment path and it should be found. Although WinError 126 could also occur if a dependent dll is missing, in my local tests when I deliberately created that situation, instead, segmentation fault (access violation at 0x0000000000000000) is thrown.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605447906
 
 
   WIN_GPU_MKLDNN is having a flaky issue similar to https://github.com/pytorch/pytorch/issues/25393
   
   Also need to update 3rdparty/dmlc-core to the latest to support VS2019

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r397595136
 
 

 ##########
 File path: ci/windows_dev_env/windows_deps_headless_installer.py
 ##########
 @@ -0,0 +1,429 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+"""Dependency installer for Windows"""
+
+__author__ = 'Pedro Larroy, Chance Bair'
+__version__ = '0.2'
+
+import argparse
+import errno
+import logging
+import os
+import psutil
+import shutil
+import subprocess
+import urllib
+import stat
+import tempfile
+import zipfile
+from time import sleep
+from urllib.error import HTTPError
+import logging
+from subprocess import check_output, check_call, call
+import re
+import sys
+import urllib.request
+import contextlib
+
+import ssl
+
+ssl._create_default_https_context = ssl._create_unverified_context
+
+log = logging.getLogger(__name__)
+
+
+DEPS = {
+    'openblas': 'https://windows-post-install.s3-us-west-2.amazonaws.com/OpenBLAS-windows-v0_2_19.zip',
+    'opencv': 'https://windows-post-install.s3-us-west-2.amazonaws.com/opencv-windows-4.1.2-vc14_vc15.zip',
+    'cudnn': 'https://windows-post-install.s3-us-west-2.amazonaws.com/cudnn-9.2-windows10-x64-v7.4.2.24.zip',
+    'nvdriver': 'https://windows-post-install.s3-us-west-2.amazonaws.com/nvidia_display_drivers_398.75_server2016.zip',
+    'perl': 'http://strawberryperl.com/download/5.30.1.1/strawberry-perl-5.30.1.1-64bit.msi',
+    'clang': 'https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/LLVM-9.0.1-win64.exe',
+    # This installation of CMake breaks windows PATH when executing vcvars, installing from
+    # chocolatey from powershell instead.
+    'cmake': 'https://github.com/Kitware/CMake/releases/download/v3.16.2/cmake-3.16.2-win64-x64.msi'
+}
+
+DEFAULT_SUBPROCESS_TIMEOUT = 3600
+
+
+@contextlib.contextmanager
+def remember_cwd():
+    '''
+    Restore current directory when exiting context
+    '''
+    curdir = os.getcwd()
+    try:
+        yield
+    finally:
+        os.chdir(curdir)
+
+
+def retry(target_exception, tries=4, delay_s=1, backoff=2):
+    """Retry calling the decorated function using an exponential backoff.
+
+    http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/
+    original from: http://wiki.python.org/moin/PythonDecoratorLibrary#Retry
+
+    :param target_exception: the exception to check. may be a tuple of
+        exceptions to check
+    :type target_exception: Exception or tuple
+    :param tries: number of times to try (not retry) before giving up
+    :type tries: int
+    :param delay_s: initial delay between retries in seconds
+    :type delay_s: int
+    :param backoff: backoff multiplier e.g. value of 2 will double the delay
+        each retry
+    :type backoff: int
+    """
+    import time
+    from functools import wraps
+
+    def decorated_retry(f):
+        @wraps(f)
+        def f_retry(*args, **kwargs):
+            mtries, mdelay = tries, delay_s
+            while mtries > 1:
+                try:
+                    return f(*args, **kwargs)
+                except target_exception as e:
+                    logging.warning("Exception: %s, Retrying in %d seconds...", str(e), mdelay)
+                    time.sleep(mdelay)
+                    mtries -= 1
+                    mdelay *= backoff
+            return f(*args, **kwargs)
+
+        return f_retry  # true decorator
+
+    return decorated_retry
+
+
+@retry((ValueError, OSError, HTTPError), tries=5, delay_s=2, backoff=5)
+def download(url, dest=None, progress=False) -> str:
+    from urllib.request import urlopen
+    from urllib.parse import (urlparse, urlunparse)
+    import progressbar
+    import http.client
+
+    class ProgressCB():
+        def __init__(self):
+            self.pbar = None
+
+        def __call__(self, block_num, block_size, total_size):
+            if not self.pbar and total_size > 0:
+                self.pbar = progressbar.bar.ProgressBar(max_value=total_size)
+            downloaded = block_num * block_size
+            if self.pbar:
+                if downloaded < total_size:
+                    self.pbar.update(downloaded)
+                else:
+                    self.pbar.finish()
+    if dest and os.path.isdir(dest):
+        local_file = os.path.split(urlparse(url).path)[1]
+        local_path = os.path.normpath(os.path.join(dest, local_file))
+    else:
+        local_path = dest
+    with urlopen(url) as c:
+        content_length = c.getheader('content-length')
+        length = int(content_length) if content_length and isinstance(c, http.client.HTTPResponse) else None
+        if length and local_path and os.path.exists(local_path) and os.stat(local_path).st_size == length:
+            log.debug(f"download('{url}'): Already downloaded.")
+            return local_path
+    log.debug(f"download({url}, {local_path}): downloading {length} bytes")
+    if local_path:
+        with tempfile.NamedTemporaryFile(delete=False) as tmpfd:
+            urllib.request.urlretrieve(url, filename=tmpfd.name, reporthook=ProgressCB() if progress else None)
+            shutil.move(tmpfd.name, local_path)
+    else:
+        (local_path, _) = urllib.request.urlretrieve(url, reporthook=ProgressCB())
+    log.debug(f"download({url}, {local_path}'): done.")
+    return local_path
+
+
+# Takes arguments and runs command on host.  Shell is disabled by default.
+# TODO: Move timeout to args
+def run_command(*args, shell=False, timeout=DEFAULT_SUBPROCESS_TIMEOUT, **kwargs):
+    try:
+        logging.info("Issuing command: {}".format(args))
+        res = subprocess.check_output(*args, shell=shell, timeout=timeout).decode("utf-8").replace("\r\n", "\n")
+        logging.info("Output: {}".format(res))
+    except subprocess.CalledProcessError as e:
+        raise RuntimeError("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
+    return res
+
+
+# Copies source directory recursively to destination.
+def copy(src, dest):
+    try:
+        shutil.copytree(src, dest)
+        logging.info("Moved {} to {}".format(src, dest))
+    except OSError as e:
+        # If the error was caused because the source wasn't a directory
+        if e.errno == errno.ENOTDIR:
+            shutil.copy(src, dest)
+            logging.info("Moved {} to {}".format(src, dest))
+        else:
+            raise RuntimeError("copy return with error: {}".format(e))
+
+
+# Workaround for windows readonly attribute error
+def on_rm_error(func, path, exc_info):
+    # path contains the path of the file that couldn't be removed
+    # let's just assume that it's read-only and unlink it.
+    os.chmod(path, stat.S_IWRITE)
+    os.unlink(path)
+
+
+def install_vs():
+    # Visual Studio CE 2017
+    # Path: C:\Program Files (x86)\Microsoft Visual Studio 14.0
+    # Components: https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2017#visual-studio-core-editor-included-with-visual-studio-community-2017
+    logging.info("Installing Visual Studio CE 2017...")
+    vs_file_path = download('https://aka.ms/eac464')
+    run_command("PowerShell Rename-Item -Path {} -NewName \"{}.exe\"".format(vs_file_path,
+                                                                             vs_file_path.split('\\')[-1]), shell=True)
+    vs_file_path = vs_file_path + '.exe'
+    ret = call(vs_file_path +
+               ' --add Microsoft.VisualStudio.Workload.ManagedDesktop'
+               ' --add Microsoft.VisualStudio.Workload.NetCoreTools'
+               ' --add Microsoft.VisualStudio.Workload.NetWeb'
+               ' --add Microsoft.VisualStudio.Workload.Node'
+               ' --add Microsoft.VisualStudio.Workload.Office'
+               ' --add Microsoft.VisualStudio.Component.TypeScript.2.0'
+               ' --add Microsoft.VisualStudio.Component.TestTools.WebLoadTest'
+               ' --add Component.GitHub.VisualStudio'
+               ' --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core'
+               ' --add Microsoft.VisualStudio.Component.Static.Analysis.Tools'
+               ' --add Microsoft.VisualStudio.Component.VC.CMake.Project'
+               ' --add Microsoft.VisualStudio.Component.VC.140'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.Desktop'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.UWP'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.UWP.Native'
+               ' --add Microsoft.VisualStudio.ComponentGroup.Windows10SDK.15063'
+               ' --wait'
+               ' --passive'
+               ' --norestart'
+               )
+
+    if ret == 3010 or ret == 0:
+        # 3010 is restart required
+        logging.info("VS install successful.")
+    else:
+        raise RuntimeError("VS failed to install, exit status {}".format(ret))
+    # Workaround for --wait sometimes ignoring the subprocesses doing component installs
+
+    def vs_still_installing():
+        return {'vs_installer.exe', 'vs_installershell.exe', 'vs_setup_bootstrapper.exe'} & set(map(lambda process: process.name(), psutil.process_iter()))
+    timer = 0
+    while vs_still_installing() and timer < DEFAULT_SUBPROCESS_TIMEOUT:
+        logging.warning("VS installers still running for %d s", timer)
+        if timer % 60 == 0:
+            logging.info("Waiting for Visual Studio to install for the last {} seconds".format(str(timer)))
+        sleep(1)
+        timer += 1
+    if vs_still_installing():
+        logging.warning("VS install still running after timeout (%d)", DEFAULT_SUBPROCESS_TIMEOUT)
+    else:
+        logging.info("Visual studio install complete.")
+
+
+def install_cmake():
+    logging.info("Installing CMAKE")
+    cmake_file_path = download(DEPS['cmake'], '.')
+    check_call(['msiexec ', '/n', '/passive', '/i', cmake_file_path])
+    logging.info("CMAKE install complete")
+
+
+def install_perl():
+    logging.info("Installing Perl")
+    with tempfile.TemporaryDirectory() as tmpdir:
+        perl_file_path = download(DEPS['perl'], tmpdir)
+        check_call(['msiexec ', '/n', '/passive', '/i', perl_file_path])
+    logging.info("Perl install complete")
+
+
+def install_clang():
 
 Review comment:
   They probably need to support tvm op build on windows as well, which may need this.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-606461815
 
 
   @leezu Thank you for checking the instance type and changing the cuda arch to 5.2, the ci is running now. @ChaiBapchya previously the segfault was caused by specifying 7.0 on the g3 instance.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605572269
 
 
   > @vexilligera as discussed offline, lets try testing locally for WIN_GPU and WIN_GPU_MKLDNN build 10 times each (since 1 run takes 20-30mins) to come up with some basis... (ideally would have tried 100 times but given the resource & time constraints)
   
   On my local test, the WIN_GPU_MKLDNN is much more flaky than WIN_GPU, as all WIN_GPU builds passed while about 1/3 of WIN_GPU_MKLDNN builds failed, based on my historical test data.
   
   @ChaiBapchya suggests introducing a maximum retry number to circumvent this flaky issue as pytorch has done here https://github.com/pytorch/pytorch/pull/35375
   
   @haojin2 suggests us removing the WIN_GPU_MKLDNN test entirely since MKLDNN doesn't make much sense as we are running on GPU, and GPU_MKLDNN case is covered on other platforms.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera closed pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera closed pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-607061503
 
 
   @leezu seems like adding both 5.2 and 7.0 and then drop 7.0 would trigger a normal run...
   See here: http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/44/
   
   With @josephevans 's fix I think the CI is working now.
   Update: still run into segfault...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605545160
 
 
   @mxnet-bot run ci [windows-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-604208726
 
 
   > Making it public is redistribution and thus license infringement.
   
   I may also need to upload the VS2019 web installer as in `install_vs`, since the original download page needs redirection to the file url and I couldn't find any short url as for VS2017.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605556855
 
 
   @vexilligera as discussed offline, lets try testing locally for WIN_GPU and WIN_GPU_MKLDNN build 10 times each (since 1 run takes 20-30mins) to come up with some basis... (ideally would have tried 100 times but given the resource & time constraints)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-606725758
 
 
   @ChaiBapchya I added instance type auto-detection and found out c5 was running the GPU ci, which caused the segfault.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605447906
 
 
   WIN_GPU_MKLDNN is having a flaky issue similar to https://github.com/pytorch/pytorch/issues/25393
   
   Also it would be great if someone could help update 3rdparty/dmlc-core, since there was a necessary fix just merged days ago to support VS2019 build and the GPU build just failed because of that, thank you!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605572269
 
 
   > @vexilligera as discussed offline, lets try testing locally for WIN_GPU and WIN_GPU_MKLDNN build 10 times each (since 1 run takes 20-30mins) to come up with some basis... (ideally would have tried 100 times but given the resource & time constraints)
   
   On my local test, the WIN_GPU_MKLDNN is much more flaky than WIN_GPU, as all WIN_GPU builds passed while about 1/3 of WIN_GPU_MKLDNN builds failed.
   
   @haojin2 suggests us removing the WIN_GPU_MKLDNN test entirely since MKLDNN doesn't make much sense as we are running on GPU, and GPU_MKLDNN case is covered on other platforms.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402556293
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -106,29 +129,37 @@ class BuildFlavour(Enum):
         '-DCMAKE_BUILD_TYPE=Release')
 
     , 'WIN_GPU': (
+        '-DCMAKE_C_COMPILER=cl '
+        '-DCMAKE_CXX_COMPILER=cl '
         '-DUSE_CUDA=ON '
         '-DUSE_CUDNN=ON '
         '-DENABLE_CUDA_RTC=ON '
         '-DUSE_OPENCV=ON  '
+        '-DOpenCV_RUNTIME=vc15 '
+        '-DOpenCV_ARCH=x64 '
         '-DUSE_OPENMP=ON '
         '-DUSE_BLAS=open '
         '-DUSE_LAPACK=ON '
         '-DUSE_DIST_KVSTORE=OFF '
-        '-DMXNET_CUDA_ARCH="5.2" '
+        '-DMXNET_CUDA_ARCH="7.5" '
 
 Review comment:
   This change sets the tested cuda architecture. The CI server now uses T4 GPUs which use 7.5 arch. Thus no, I can't change this back.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r390727421
 
 

 ##########
 File path: ci/windows_dev_env/windows_deps_headless_installer.py
 ##########
 @@ -0,0 +1,429 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+"""Dependency installer for Windows"""
+
+__author__ = 'Pedro Larroy, Chance Bair'
+__version__ = '0.2'
+
+import argparse
+import errno
+import logging
+import os
+import psutil
+import shutil
+import subprocess
+import urllib
+import stat
+import tempfile
+import zipfile
+from time import sleep
+from urllib.error import HTTPError
+import logging
+from subprocess import check_output, check_call, call
+import re
+import sys
+import urllib.request
+import contextlib
+
+import ssl
+
+ssl._create_default_https_context = ssl._create_unverified_context
+
+log = logging.getLogger(__name__)
+
+
+DEPS = {
+    'openblas': 'https://windows-post-install.s3-us-west-2.amazonaws.com/OpenBLAS-windows-v0_2_19.zip',
+    'opencv': 'https://windows-post-install.s3-us-west-2.amazonaws.com/opencv-windows-4.1.2-vc14_vc15.zip',
+    'cudnn': 'https://windows-post-install.s3-us-west-2.amazonaws.com/cudnn-9.2-windows10-x64-v7.4.2.24.zip',
+    'nvdriver': 'https://windows-post-install.s3-us-west-2.amazonaws.com/nvidia_display_drivers_398.75_server2016.zip',
+    'perl': 'http://strawberryperl.com/download/5.30.1.1/strawberry-perl-5.30.1.1-64bit.msi',
+    'clang': 'https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/LLVM-9.0.1-win64.exe',
+    # This installation of CMake breaks windows PATH when executing vcvars, installing from
+    # chocolatey from powershell instead.
+    'cmake': 'https://github.com/Kitware/CMake/releases/download/v3.16.2/cmake-3.16.2-win64-x64.msi'
+}
+
+DEFAULT_SUBPROCESS_TIMEOUT = 3600
+
+
+@contextlib.contextmanager
+def remember_cwd():
+    '''
+    Restore current directory when exiting context
+    '''
+    curdir = os.getcwd()
+    try:
+        yield
+    finally:
+        os.chdir(curdir)
+
+
+def retry(target_exception, tries=4, delay_s=1, backoff=2):
+    """Retry calling the decorated function using an exponential backoff.
+
+    http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/
+    original from: http://wiki.python.org/moin/PythonDecoratorLibrary#Retry
+
+    :param target_exception: the exception to check. may be a tuple of
+        exceptions to check
+    :type target_exception: Exception or tuple
+    :param tries: number of times to try (not retry) before giving up
+    :type tries: int
+    :param delay_s: initial delay between retries in seconds
+    :type delay_s: int
+    :param backoff: backoff multiplier e.g. value of 2 will double the delay
+        each retry
+    :type backoff: int
+    """
+    import time
+    from functools import wraps
+
+    def decorated_retry(f):
+        @wraps(f)
+        def f_retry(*args, **kwargs):
+            mtries, mdelay = tries, delay_s
+            while mtries > 1:
+                try:
+                    return f(*args, **kwargs)
+                except target_exception as e:
+                    logging.warning("Exception: %s, Retrying in %d seconds...", str(e), mdelay)
+                    time.sleep(mdelay)
+                    mtries -= 1
+                    mdelay *= backoff
+            return f(*args, **kwargs)
+
+        return f_retry  # true decorator
+
+    return decorated_retry
+
+
+@retry((ValueError, OSError, HTTPError), tries=5, delay_s=2, backoff=5)
+def download(url, dest=None, progress=False) -> str:
+    from urllib.request import urlopen
+    from urllib.parse import (urlparse, urlunparse)
+    import progressbar
+    import http.client
+
+    class ProgressCB():
+        def __init__(self):
+            self.pbar = None
+
+        def __call__(self, block_num, block_size, total_size):
+            if not self.pbar and total_size > 0:
+                self.pbar = progressbar.bar.ProgressBar(max_value=total_size)
+            downloaded = block_num * block_size
+            if self.pbar:
+                if downloaded < total_size:
+                    self.pbar.update(downloaded)
+                else:
+                    self.pbar.finish()
+    if dest and os.path.isdir(dest):
+        local_file = os.path.split(urlparse(url).path)[1]
+        local_path = os.path.normpath(os.path.join(dest, local_file))
+    else:
+        local_path = dest
+    with urlopen(url) as c:
+        content_length = c.getheader('content-length')
+        length = int(content_length) if content_length and isinstance(c, http.client.HTTPResponse) else None
+        if length and local_path and os.path.exists(local_path) and os.stat(local_path).st_size == length:
+            log.debug(f"download('{url}'): Already downloaded.")
+            return local_path
+    log.debug(f"download({url}, {local_path}): downloading {length} bytes")
+    if local_path:
+        with tempfile.NamedTemporaryFile(delete=False) as tmpfd:
+            urllib.request.urlretrieve(url, filename=tmpfd.name, reporthook=ProgressCB() if progress else None)
+            shutil.move(tmpfd.name, local_path)
+    else:
+        (local_path, _) = urllib.request.urlretrieve(url, reporthook=ProgressCB())
+    log.debug(f"download({url}, {local_path}'): done.")
+    return local_path
+
+
+# Takes arguments and runs command on host.  Shell is disabled by default.
+# TODO: Move timeout to args
+def run_command(*args, shell=False, timeout=DEFAULT_SUBPROCESS_TIMEOUT, **kwargs):
+    try:
+        logging.info("Issuing command: {}".format(args))
+        res = subprocess.check_output(*args, shell=shell, timeout=timeout).decode("utf-8").replace("\r\n", "\n")
+        logging.info("Output: {}".format(res))
+    except subprocess.CalledProcessError as e:
+        raise RuntimeError("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
+    return res
+
+
+# Copies source directory recursively to destination.
+def copy(src, dest):
+    try:
+        shutil.copytree(src, dest)
+        logging.info("Moved {} to {}".format(src, dest))
+    except OSError as e:
+        # If the error was caused because the source wasn't a directory
+        if e.errno == errno.ENOTDIR:
+            shutil.copy(src, dest)
+            logging.info("Moved {} to {}".format(src, dest))
+        else:
+            raise RuntimeError("copy return with error: {}".format(e))
+
+
+# Workaround for windows readonly attribute error
+def on_rm_error(func, path, exc_info):
+    # path contains the path of the file that couldn't be removed
+    # let's just assume that it's read-only and unlink it.
+    os.chmod(path, stat.S_IWRITE)
+    os.unlink(path)
+
+
+def install_vs():
+    # Visual Studio CE 2017
+    # Path: C:\Program Files (x86)\Microsoft Visual Studio 14.0
+    # Components: https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2017#visual-studio-core-editor-included-with-visual-studio-community-2017
+    logging.info("Installing Visual Studio CE 2017...")
+    vs_file_path = download('https://aka.ms/eac464')
+    run_command("PowerShell Rename-Item -Path {} -NewName \"{}.exe\"".format(vs_file_path,
+                                                                             vs_file_path.split('\\')[-1]), shell=True)
+    vs_file_path = vs_file_path + '.exe'
+    ret = call(vs_file_path +
+               ' --add Microsoft.VisualStudio.Workload.ManagedDesktop'
+               ' --add Microsoft.VisualStudio.Workload.NetCoreTools'
+               ' --add Microsoft.VisualStudio.Workload.NetWeb'
+               ' --add Microsoft.VisualStudio.Workload.Node'
+               ' --add Microsoft.VisualStudio.Workload.Office'
+               ' --add Microsoft.VisualStudio.Component.TypeScript.2.0'
+               ' --add Microsoft.VisualStudio.Component.TestTools.WebLoadTest'
+               ' --add Component.GitHub.VisualStudio'
+               ' --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core'
+               ' --add Microsoft.VisualStudio.Component.Static.Analysis.Tools'
+               ' --add Microsoft.VisualStudio.Component.VC.CMake.Project'
+               ' --add Microsoft.VisualStudio.Component.VC.140'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.Desktop'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.UWP'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.UWP.Native'
+               ' --add Microsoft.VisualStudio.ComponentGroup.Windows10SDK.15063'
+               ' --wait'
+               ' --passive'
+               ' --norestart'
+               )
+
+    if ret == 3010 or ret == 0:
+        # 3010 is restart required
+        logging.info("VS install successful.")
+    else:
+        raise RuntimeError("VS failed to install, exit status {}".format(ret))
+    # Workaround for --wait sometimes ignoring the subprocesses doing component installs
+
+    def vs_still_installing():
+        return {'vs_installer.exe', 'vs_installershell.exe', 'vs_setup_bootstrapper.exe'} & set(map(lambda process: process.name(), psutil.process_iter()))
+    timer = 0
+    while vs_still_installing() and timer < DEFAULT_SUBPROCESS_TIMEOUT:
+        logging.warning("VS installers still running for %d s", timer)
+        if timer % 60 == 0:
+            logging.info("Waiting for Visual Studio to install for the last {} seconds".format(str(timer)))
+        sleep(1)
+        timer += 1
+    if vs_still_installing():
+        logging.warning("VS install still running after timeout (%d)", DEFAULT_SUBPROCESS_TIMEOUT)
+    else:
+        logging.info("Visual studio install complete.")
+
+
+def install_cmake():
 
 Review comment:
   Unused

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605611140
 
 
   > Sorry but I don't believe that you are testing the development on a VM when this kind of commit is necessary.
   
   Was testing on one instance and made commits on another...manually copied the code and missed some parts...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r401361553
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -193,14 +238,19 @@ def windows_package(args):
         for dll in dlls:
             logging.info("packing dll: %s", dll)
             shutil.copy(dll, pkgdir_lib)
+
+        if pkgdir_lib.find('gpu') != -1:
+            add_path("C:\\jenkins_slave\\workspace\\ut-python-gpu\\windows_package\\lib")
 
 Review comment:
   That's right, forgot to remove that. Will add that to the testing phase once we get the log from ad95025

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-607576186
 
 
   Jenkins CI successfully triggered : [windows-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605447906
 
 
   WIN_GPU_MKLDNN is having a flaky issue similar to https://github.com/pytorch/pytorch/issues/25393
   
   Also need to update dmlc-core to the latest to support VS2019

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r390726040
 
 

 ##########
 File path: ci/windows_dev_env/windows_deps_headless_installer.py
 ##########
 @@ -0,0 +1,429 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+"""Dependency installer for Windows"""
+
+__author__ = 'Pedro Larroy, Chance Bair'
+__version__ = '0.2'
+
+import argparse
+import errno
+import logging
+import os
+import psutil
+import shutil
+import subprocess
+import urllib
+import stat
+import tempfile
+import zipfile
+from time import sleep
+from urllib.error import HTTPError
+import logging
+from subprocess import check_output, check_call, call
+import re
+import sys
+import urllib.request
+import contextlib
+
+import ssl
+
+ssl._create_default_https_context = ssl._create_unverified_context
+
+log = logging.getLogger(__name__)
+
+
+DEPS = {
+    'openblas': 'https://windows-post-install.s3-us-west-2.amazonaws.com/OpenBLAS-windows-v0_2_19.zip',
+    'opencv': 'https://windows-post-install.s3-us-west-2.amazonaws.com/opencv-windows-4.1.2-vc14_vc15.zip',
+    'cudnn': 'https://windows-post-install.s3-us-west-2.amazonaws.com/cudnn-9.2-windows10-x64-v7.4.2.24.zip',
+    'nvdriver': 'https://windows-post-install.s3-us-west-2.amazonaws.com/nvidia_display_drivers_398.75_server2016.zip',
 
 Review comment:
   Who owns the `windows-post-install` bucket?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-607061503
 
 
   @leezu seems like adding both 5.2 and 7.0 and then dropping 7.0 would trigger a normal run...but each run should be independent, right?
   See here: http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/44/
   
   With @josephevans 's fix I think the CI is working now.
   Update: still runs into segfault...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605283539
 
 
   Turns out the path mentioned in ci/build_windows.py is correct
   ```
   VS 2019': r'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsx86_amd64.bat
   ```
   That is exactly where the bat file is.
   
   [verified this by launching an instance using the updated windows AMI]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-608023880
 
 
   @marcoabreu Do you still stand by your veto?
   
   > "Retries are fine for now, but must be removed before merging."
   
   I suggest to go ahead and merge this with the retries. We don't have control over the thrust + VS code incompatibility and may need to wait for a fix on nvidia's or microsoft's side. Doesn't seem worth to block all MXNet development until the bug in "thrust + VS code" is fixed, given it's an open issue affecting other projects as well: https://github.com/pytorch/pytorch/issues/25393
   
   The issue is tracked on our side in https://github.com/apache/incubator-mxnet/issues/17935

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402549416
 
 

 ##########
 File path: CMakeLists.txt
 ##########
 @@ -163,6 +163,8 @@ if(MSVC)
   add_definitions(-DDMLC_STRICT_CXX11)
   add_definitions(-DNOMINMAX)
   set(CMAKE_C_FLAGS "/MP")
+  # report an accurate value for recent C++ language standards support
+  set(CMAKE_CXX_FLAGS "/Zc:__cplusplus")
 
 Review comment:
   the typo!!!! `CMAKE_CXX_FLAGS` instead of `CMAKE_C_FLAGS`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-607061503
 
 
   @leezu seems like adding both 5.2 and 7.0 and then drop 7.0 would trigger a normal run...
   See here: http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/44/

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-606545045
 
 
   @mxnet-bot run ci [windows-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-607061503
 
 
   @leezu seems like adding both 5.2 and 7.0 and then drop 7.0 would trigger a normal run...
   See here: http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/44/
   
   With @josephevans 's fix I think the CI is working now.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-604250636
 
 
   Updated links for cudnn & VS2019
   - https://windows-post-install.s3-us-west-2.amazonaws.com/vs_community__1246179388.1585201415.exe
   - https://windows-post-install.s3-us-west-2.amazonaws.com/cudnn-10.2-windows10-x64-v7.6.5.32.zip

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605549589
 
 
   @mxnet-bot run ci [unix-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605555389
 
 
   @marcoabreu Even in this case, @vexilligera is unable to reproduce the error locally. And WIN_GPU and WIN_GPU_MKLDNN is flaky. How do you suggest we proceed trying to resolve the thrust issue on CI?
   
   Fail : http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/13/pipeline
   Pass : http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17808/12/pipeline
   
   As pointed out in the pytorch issue : https://github.com/pytorch/pytorch/issues/25393
   they face a similar problem with their Windows CI

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605897612
 
 
   > Test in WIN_GPU fail at
   > 
   > ```
   > OSError: [WinError 126] The specified module could not be found
   > ```
   > 
   > This one means the libmxnet.dll is not in the DLL Search path [acc to Stackoverflow]
   > Fix would be to add it into the environment
   > https://stackoverflow.com/questions/43987081/openslide-python-import-error
   > 
   > What's surprising is : libmxnet.dll & mxnet_70.dll are being packed into windows_package.7z and unpacked during test phase correctly.
   > While WIN_CPU tests don't give this error, WIN_GPU fails
   
   @larroy says he used to run into the problem and it was solved by packing opencv binary. In this case the opencv is already in the environment path and it should be found. Although WinError 126 could also occur if a dependent dll is missing, in my local tests when I deliberately created that situation, segmentation fault (access violation at 0x0000000000000000) is thrown instead.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402551394
 
 

 ##########
 File path: ci/safe_docker_run.py
 ##########
 @@ -38,8 +38,9 @@
 
 from util import config_logging
 
-DOCKER_STOP_TIMEOUT_SECONDS = 3
+DOCKER_STOP_TIMEOUT_SECONDS = 10
 
 Review comment:
   Unrelated change

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-604739359
 
 
   Jenkins CI successfully triggered : [windows-cpu, windows-gpu]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r390727660
 
 

 ##########
 File path: ci/windows_dev_env/windows_deps_headless_installer.py
 ##########
 @@ -0,0 +1,429 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+"""Dependency installer for Windows"""
+
+__author__ = 'Pedro Larroy, Chance Bair'
+__version__ = '0.2'
+
+import argparse
+import errno
+import logging
+import os
+import psutil
+import shutil
+import subprocess
+import urllib
+import stat
+import tempfile
+import zipfile
+from time import sleep
+from urllib.error import HTTPError
+import logging
+from subprocess import check_output, check_call, call
+import re
+import sys
+import urllib.request
+import contextlib
+
+import ssl
+
+ssl._create_default_https_context = ssl._create_unverified_context
+
+log = logging.getLogger(__name__)
+
+
+DEPS = {
+    'openblas': 'https://windows-post-install.s3-us-west-2.amazonaws.com/OpenBLAS-windows-v0_2_19.zip',
+    'opencv': 'https://windows-post-install.s3-us-west-2.amazonaws.com/opencv-windows-4.1.2-vc14_vc15.zip',
+    'cudnn': 'https://windows-post-install.s3-us-west-2.amazonaws.com/cudnn-9.2-windows10-x64-v7.4.2.24.zip',
+    'nvdriver': 'https://windows-post-install.s3-us-west-2.amazonaws.com/nvidia_display_drivers_398.75_server2016.zip',
+    'perl': 'http://strawberryperl.com/download/5.30.1.1/strawberry-perl-5.30.1.1-64bit.msi',
+    'clang': 'https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/LLVM-9.0.1-win64.exe',
+    # This installation of CMake breaks windows PATH when executing vcvars, installing from
+    # chocolatey from powershell instead.
+    'cmake': 'https://github.com/Kitware/CMake/releases/download/v3.16.2/cmake-3.16.2-win64-x64.msi'
+}
+
+DEFAULT_SUBPROCESS_TIMEOUT = 3600
+
+
+@contextlib.contextmanager
+def remember_cwd():
+    '''
+    Restore current directory when exiting context
+    '''
+    curdir = os.getcwd()
+    try:
+        yield
+    finally:
+        os.chdir(curdir)
+
+
+def retry(target_exception, tries=4, delay_s=1, backoff=2):
+    """Retry calling the decorated function using an exponential backoff.
+
+    http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/
+    original from: http://wiki.python.org/moin/PythonDecoratorLibrary#Retry
+
+    :param target_exception: the exception to check. may be a tuple of
+        exceptions to check
+    :type target_exception: Exception or tuple
+    :param tries: number of times to try (not retry) before giving up
+    :type tries: int
+    :param delay_s: initial delay between retries in seconds
+    :type delay_s: int
+    :param backoff: backoff multiplier e.g. value of 2 will double the delay
+        each retry
+    :type backoff: int
+    """
+    import time
+    from functools import wraps
+
+    def decorated_retry(f):
+        @wraps(f)
+        def f_retry(*args, **kwargs):
+            mtries, mdelay = tries, delay_s
+            while mtries > 1:
+                try:
+                    return f(*args, **kwargs)
+                except target_exception as e:
+                    logging.warning("Exception: %s, Retrying in %d seconds...", str(e), mdelay)
+                    time.sleep(mdelay)
+                    mtries -= 1
+                    mdelay *= backoff
+            return f(*args, **kwargs)
+
+        return f_retry  # true decorator
+
+    return decorated_retry
+
+
+@retry((ValueError, OSError, HTTPError), tries=5, delay_s=2, backoff=5)
+def download(url, dest=None, progress=False) -> str:
+    from urllib.request import urlopen
+    from urllib.parse import (urlparse, urlunparse)
+    import progressbar
+    import http.client
+
+    class ProgressCB():
+        def __init__(self):
+            self.pbar = None
+
+        def __call__(self, block_num, block_size, total_size):
+            if not self.pbar and total_size > 0:
+                self.pbar = progressbar.bar.ProgressBar(max_value=total_size)
+            downloaded = block_num * block_size
+            if self.pbar:
+                if downloaded < total_size:
+                    self.pbar.update(downloaded)
+                else:
+                    self.pbar.finish()
+    if dest and os.path.isdir(dest):
+        local_file = os.path.split(urlparse(url).path)[1]
+        local_path = os.path.normpath(os.path.join(dest, local_file))
+    else:
+        local_path = dest
+    with urlopen(url) as c:
+        content_length = c.getheader('content-length')
+        length = int(content_length) if content_length and isinstance(c, http.client.HTTPResponse) else None
+        if length and local_path and os.path.exists(local_path) and os.stat(local_path).st_size == length:
+            log.debug(f"download('{url}'): Already downloaded.")
+            return local_path
+    log.debug(f"download({url}, {local_path}): downloading {length} bytes")
+    if local_path:
+        with tempfile.NamedTemporaryFile(delete=False) as tmpfd:
+            urllib.request.urlretrieve(url, filename=tmpfd.name, reporthook=ProgressCB() if progress else None)
+            shutil.move(tmpfd.name, local_path)
+    else:
+        (local_path, _) = urllib.request.urlretrieve(url, reporthook=ProgressCB())
+    log.debug(f"download({url}, {local_path}'): done.")
+    return local_path
+
+
+# Takes arguments and runs command on host.  Shell is disabled by default.
+# TODO: Move timeout to args
+def run_command(*args, shell=False, timeout=DEFAULT_SUBPROCESS_TIMEOUT, **kwargs):
+    try:
+        logging.info("Issuing command: {}".format(args))
+        res = subprocess.check_output(*args, shell=shell, timeout=timeout).decode("utf-8").replace("\r\n", "\n")
+        logging.info("Output: {}".format(res))
+    except subprocess.CalledProcessError as e:
+        raise RuntimeError("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
+    return res
+
+
+# Copies source directory recursively to destination.
+def copy(src, dest):
+    try:
+        shutil.copytree(src, dest)
+        logging.info("Moved {} to {}".format(src, dest))
+    except OSError as e:
+        # If the error was caused because the source wasn't a directory
+        if e.errno == errno.ENOTDIR:
+            shutil.copy(src, dest)
+            logging.info("Moved {} to {}".format(src, dest))
+        else:
+            raise RuntimeError("copy return with error: {}".format(e))
+
+
+# Workaround for windows readonly attribute error
+def on_rm_error(func, path, exc_info):
+    # path contains the path of the file that couldn't be removed
+    # let's just assume that it's read-only and unlink it.
+    os.chmod(path, stat.S_IWRITE)
+    os.unlink(path)
+
+
+def install_vs():
+    # Visual Studio CE 2017
+    # Path: C:\Program Files (x86)\Microsoft Visual Studio 14.0
+    # Components: https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2017#visual-studio-core-editor-included-with-visual-studio-community-2017
+    logging.info("Installing Visual Studio CE 2017...")
+    vs_file_path = download('https://aka.ms/eac464')
+    run_command("PowerShell Rename-Item -Path {} -NewName \"{}.exe\"".format(vs_file_path,
+                                                                             vs_file_path.split('\\')[-1]), shell=True)
+    vs_file_path = vs_file_path + '.exe'
+    ret = call(vs_file_path +
+               ' --add Microsoft.VisualStudio.Workload.ManagedDesktop'
+               ' --add Microsoft.VisualStudio.Workload.NetCoreTools'
+               ' --add Microsoft.VisualStudio.Workload.NetWeb'
+               ' --add Microsoft.VisualStudio.Workload.Node'
+               ' --add Microsoft.VisualStudio.Workload.Office'
+               ' --add Microsoft.VisualStudio.Component.TypeScript.2.0'
+               ' --add Microsoft.VisualStudio.Component.TestTools.WebLoadTest'
+               ' --add Component.GitHub.VisualStudio'
+               ' --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core'
+               ' --add Microsoft.VisualStudio.Component.Static.Analysis.Tools'
+               ' --add Microsoft.VisualStudio.Component.VC.CMake.Project'
+               ' --add Microsoft.VisualStudio.Component.VC.140'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.Desktop'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.UWP'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.UWP.Native'
+               ' --add Microsoft.VisualStudio.ComponentGroup.Windows10SDK.15063'
+               ' --wait'
+               ' --passive'
+               ' --norestart'
+               )
+
+    if ret == 3010 or ret == 0:
+        # 3010 is restart required
+        logging.info("VS install successful.")
+    else:
+        raise RuntimeError("VS failed to install, exit status {}".format(ret))
+    # Workaround for --wait sometimes ignoring the subprocesses doing component installs
+
+    def vs_still_installing():
+        return {'vs_installer.exe', 'vs_installershell.exe', 'vs_setup_bootstrapper.exe'} & set(map(lambda process: process.name(), psutil.process_iter()))
+    timer = 0
+    while vs_still_installing() and timer < DEFAULT_SUBPROCESS_TIMEOUT:
+        logging.warning("VS installers still running for %d s", timer)
+        if timer % 60 == 0:
+            logging.info("Waiting for Visual Studio to install for the last {} seconds".format(str(timer)))
+        sleep(1)
+        timer += 1
+    if vs_still_installing():
+        logging.warning("VS install still running after timeout (%d)", DEFAULT_SUBPROCESS_TIMEOUT)
+    else:
+        logging.info("Visual studio install complete.")
+
+
+def install_cmake():
+    logging.info("Installing CMAKE")
+    cmake_file_path = download(DEPS['cmake'], '.')
+    check_call(['msiexec ', '/n', '/passive', '/i', cmake_file_path])
+    logging.info("CMAKE install complete")
+
+
+def install_perl():
+    logging.info("Installing Perl")
+    with tempfile.TemporaryDirectory() as tmpdir:
+        perl_file_path = download(DEPS['perl'], tmpdir)
+        check_call(['msiexec ', '/n', '/passive', '/i', perl_file_path])
+    logging.info("Perl install complete")
+
+
+def install_clang():
+    logging.info("Installing Clang")
+    with tempfile.TemporaryDirectory() as tmpdir:
+        clang_file_path = download(DEPS['clang'], tmpdir)
+        run_command(clang_file_path + " /S /D=C:\\Program Files\\LLVM")
+    logging.info("Clang install complete")
+
+
+def install_openblas():
+    logging.info("Installing OpenBLAS")
+    local_file = download(DEPS['openblas'])
+    with zipfile.ZipFile(local_file, 'r') as zip:
+        zip.extractall("C:\\Program Files")
+    run_command("PowerShell Set-ItemProperty -path 'hklm:\\system\\currentcontrolset\\control\\session manager\\environment' -Name OpenBLAS_HOME -Value 'C:\\Program Files\\OpenBLAS-windows-v0_2_19'")
+    logging.info("Openblas Install complete")
+
+
+def install_mkl():
+    logging.info("Installing MKL 2019.3.203...")
+    file_path = download("http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15247/w_mkl_2019.3.203.exe")
+    run_command("{} --silent --remove-extracted-files yes --a install -output=C:\mkl-install-log.txt -eula=accept".format(file_path))
+    logging.info("MKL Install complete")
+
+
+def install_opencv():
+    logging.info("Installing OpenCV")
+    with tempfile.TemporaryDirectory() as tmpdir:
+        local_file = download(DEPS['opencv'])
+        with zipfile.ZipFile(local_file, 'r') as zip:
+            zip.extractall(tmpdir)
+        copy(f'{tmpdir}\\opencv\\build', r'c:\Program Files\opencv')
+
+    run_command("PowerShell Set-ItemProperty -path 'hklm:\\system\\currentcontrolset\\control\\session manager\\environment' -Name OpenCV_DIR -Value 'C:\\Program Files\\opencv'")
+    logging.info("OpenCV install complete")
+
+
+def install_cudnn():
+    # cuDNN
+    logging.info("Installing cuDNN")
+    with tempfile.TemporaryDirectory() as tmpdir:
+        local_file = download(DEPS['cudnn'])
+        with zipfile.ZipFile(local_file, 'r') as zip:
+            zip.extractall(tmpdir)
+        copy(tmpdir+"\\cuda\\bin\\cudnn64_7.dll", "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2\\bin")
+        copy(tmpdir+"\\cuda\\include\\cudnn.h", "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2\\include")
+        copy(tmpdir+"\\cuda\\lib\\x64\\cudnn.lib", "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2\\lib\\x64")
+    logging.info("cuDNN install complete")
+
+
+def install_gpu_driver(force=False):
+    if has_gpu() or force:
+        logging.info("GPU detected")
+        install_nvdriver()
+
+
+def install_nvdriver():
+    logging.info("Installing Nvidia Display Drivers...")
+    with tempfile.TemporaryDirectory(prefix='nvidia drivers') as tmpdir:
+        local_file = download(DEPS['nvdriver'])
+        with zipfile.ZipFile(local_file, 'r') as zip:
+            zip.extractall(tmpdir)
+        with remember_cwd():
+            os.chdir(tmpdir)
+            check_call(".\setup.exe -noreboot -clean -noeula -nofinish -passive")
+    logging.info("NVidia install complete")
+
+
+def install_cuda():
+    # CUDA 9.2 and patches
 
 Review comment:
   Enforcing Cuda 9.2 may not be very future proof for this script.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r403124035
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -253,12 +284,8 @@ def main():
     system = platform.system()
     if system == 'Windows':
         logging.info("Detected Windows platform")
-        if 'OpenBLAS_HOME' not in os.environ:
-            os.environ["OpenBLAS_HOME"] = "C:\\Program Files\\OpenBLAS-v0.2.19"
-        if 'OpenCV_DIR' not in os.environ:
-            os.environ["OpenCV_DIR"] = "C:\\Program Files\\OpenCV-v3.4.1\\build"
         if 'CUDA_PATH' not in os.environ:
-            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2"
+            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2"
 
 Review comment:
   https://superuser.com/questions/1506044/installing-cuda-9-2-with-vs-2019

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402562538
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -106,29 +129,37 @@ class BuildFlavour(Enum):
         '-DCMAKE_BUILD_TYPE=Release')
 
     , 'WIN_GPU': (
+        '-DCMAKE_C_COMPILER=cl '
+        '-DCMAKE_CXX_COMPILER=cl '
         '-DUSE_CUDA=ON '
         '-DUSE_CUDNN=ON '
         '-DENABLE_CUDA_RTC=ON '
         '-DUSE_OPENCV=ON  '
+        '-DOpenCV_RUNTIME=vc15 '
+        '-DOpenCV_ARCH=x64 '
         '-DUSE_OPENMP=ON '
         '-DUSE_BLAS=open '
         '-DUSE_LAPACK=ON '
         '-DUSE_DIST_KVSTORE=OFF '
-        '-DMXNET_CUDA_ARCH="5.2" '
+        '-DMXNET_CUDA_ARCH="7.5" '
 
 Review comment:
   Well where did we agree that we are dropping g3 instances? How is such a change in the scope of this PR?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r390727392
 
 

 ##########
 File path: ci/windows_dev_env/windows_deps_headless_installer.py
 ##########
 @@ -0,0 +1,429 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+"""Dependency installer for Windows"""
+
+__author__ = 'Pedro Larroy, Chance Bair'
+__version__ = '0.2'
+
+import argparse
+import errno
+import logging
+import os
+import psutil
+import shutil
+import subprocess
+import urllib
+import stat
+import tempfile
+import zipfile
+from time import sleep
+from urllib.error import HTTPError
+import logging
+from subprocess import check_output, check_call, call
+import re
+import sys
+import urllib.request
+import contextlib
+
+import ssl
+
+ssl._create_default_https_context = ssl._create_unverified_context
+
+log = logging.getLogger(__name__)
+
+
+DEPS = {
+    'openblas': 'https://windows-post-install.s3-us-west-2.amazonaws.com/OpenBLAS-windows-v0_2_19.zip',
+    'opencv': 'https://windows-post-install.s3-us-west-2.amazonaws.com/opencv-windows-4.1.2-vc14_vc15.zip',
+    'cudnn': 'https://windows-post-install.s3-us-west-2.amazonaws.com/cudnn-9.2-windows10-x64-v7.4.2.24.zip',
+    'nvdriver': 'https://windows-post-install.s3-us-west-2.amazonaws.com/nvidia_display_drivers_398.75_server2016.zip',
+    'perl': 'http://strawberryperl.com/download/5.30.1.1/strawberry-perl-5.30.1.1-64bit.msi',
+    'clang': 'https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/LLVM-9.0.1-win64.exe',
+    # This installation of CMake breaks windows PATH when executing vcvars, installing from
+    # chocolatey from powershell instead.
+    'cmake': 'https://github.com/Kitware/CMake/releases/download/v3.16.2/cmake-3.16.2-win64-x64.msi'
+}
+
+DEFAULT_SUBPROCESS_TIMEOUT = 3600
+
+
+@contextlib.contextmanager
+def remember_cwd():
+    '''
+    Restore current directory when exiting context
+    '''
+    curdir = os.getcwd()
+    try:
+        yield
+    finally:
+        os.chdir(curdir)
+
+
+def retry(target_exception, tries=4, delay_s=1, backoff=2):
+    """Retry calling the decorated function using an exponential backoff.
+
+    http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/
+    original from: http://wiki.python.org/moin/PythonDecoratorLibrary#Retry
+
+    :param target_exception: the exception to check. may be a tuple of
+        exceptions to check
+    :type target_exception: Exception or tuple
+    :param tries: number of times to try (not retry) before giving up
+    :type tries: int
+    :param delay_s: initial delay between retries in seconds
+    :type delay_s: int
+    :param backoff: backoff multiplier e.g. value of 2 will double the delay
+        each retry
+    :type backoff: int
+    """
+    import time
+    from functools import wraps
+
+    def decorated_retry(f):
+        @wraps(f)
+        def f_retry(*args, **kwargs):
+            mtries, mdelay = tries, delay_s
+            while mtries > 1:
+                try:
+                    return f(*args, **kwargs)
+                except target_exception as e:
+                    logging.warning("Exception: %s, Retrying in %d seconds...", str(e), mdelay)
+                    time.sleep(mdelay)
+                    mtries -= 1
+                    mdelay *= backoff
+            return f(*args, **kwargs)
+
+        return f_retry  # true decorator
+
+    return decorated_retry
+
+
+@retry((ValueError, OSError, HTTPError), tries=5, delay_s=2, backoff=5)
+def download(url, dest=None, progress=False) -> str:
+    from urllib.request import urlopen
+    from urllib.parse import (urlparse, urlunparse)
+    import progressbar
+    import http.client
+
+    class ProgressCB():
+        def __init__(self):
+            self.pbar = None
+
+        def __call__(self, block_num, block_size, total_size):
+            if not self.pbar and total_size > 0:
+                self.pbar = progressbar.bar.ProgressBar(max_value=total_size)
+            downloaded = block_num * block_size
+            if self.pbar:
+                if downloaded < total_size:
+                    self.pbar.update(downloaded)
+                else:
+                    self.pbar.finish()
+    if dest and os.path.isdir(dest):
+        local_file = os.path.split(urlparse(url).path)[1]
+        local_path = os.path.normpath(os.path.join(dest, local_file))
+    else:
+        local_path = dest
+    with urlopen(url) as c:
+        content_length = c.getheader('content-length')
+        length = int(content_length) if content_length and isinstance(c, http.client.HTTPResponse) else None
+        if length and local_path and os.path.exists(local_path) and os.stat(local_path).st_size == length:
+            log.debug(f"download('{url}'): Already downloaded.")
+            return local_path
+    log.debug(f"download({url}, {local_path}): downloading {length} bytes")
+    if local_path:
+        with tempfile.NamedTemporaryFile(delete=False) as tmpfd:
+            urllib.request.urlretrieve(url, filename=tmpfd.name, reporthook=ProgressCB() if progress else None)
+            shutil.move(tmpfd.name, local_path)
+    else:
+        (local_path, _) = urllib.request.urlretrieve(url, reporthook=ProgressCB())
+    log.debug(f"download({url}, {local_path}'): done.")
+    return local_path
+
+
+# Takes arguments and runs command on host.  Shell is disabled by default.
+# TODO: Move timeout to args
+def run_command(*args, shell=False, timeout=DEFAULT_SUBPROCESS_TIMEOUT, **kwargs):
+    try:
+        logging.info("Issuing command: {}".format(args))
+        res = subprocess.check_output(*args, shell=shell, timeout=timeout).decode("utf-8").replace("\r\n", "\n")
+        logging.info("Output: {}".format(res))
+    except subprocess.CalledProcessError as e:
+        raise RuntimeError("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
+    return res
+
+
+# Copies source directory recursively to destination.
+def copy(src, dest):
+    try:
+        shutil.copytree(src, dest)
+        logging.info("Moved {} to {}".format(src, dest))
+    except OSError as e:
+        # If the error was caused because the source wasn't a directory
+        if e.errno == errno.ENOTDIR:
+            shutil.copy(src, dest)
+            logging.info("Moved {} to {}".format(src, dest))
+        else:
+            raise RuntimeError("copy return with error: {}".format(e))
+
+
+# Workaround for windows readonly attribute error
+def on_rm_error(func, path, exc_info):
+    # path contains the path of the file that couldn't be removed
+    # let's just assume that it's read-only and unlink it.
+    os.chmod(path, stat.S_IWRITE)
+    os.unlink(path)
+
+
+def install_vs():
+    # Visual Studio CE 2017
+    # Path: C:\Program Files (x86)\Microsoft Visual Studio 14.0
+    # Components: https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2017#visual-studio-core-editor-included-with-visual-studio-community-2017
+    logging.info("Installing Visual Studio CE 2017...")
+    vs_file_path = download('https://aka.ms/eac464')
+    run_command("PowerShell Rename-Item -Path {} -NewName \"{}.exe\"".format(vs_file_path,
+                                                                             vs_file_path.split('\\')[-1]), shell=True)
+    vs_file_path = vs_file_path + '.exe'
+    ret = call(vs_file_path +
+               ' --add Microsoft.VisualStudio.Workload.ManagedDesktop'
+               ' --add Microsoft.VisualStudio.Workload.NetCoreTools'
+               ' --add Microsoft.VisualStudio.Workload.NetWeb'
+               ' --add Microsoft.VisualStudio.Workload.Node'
+               ' --add Microsoft.VisualStudio.Workload.Office'
+               ' --add Microsoft.VisualStudio.Component.TypeScript.2.0'
+               ' --add Microsoft.VisualStudio.Component.TestTools.WebLoadTest'
+               ' --add Component.GitHub.VisualStudio'
+               ' --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core'
+               ' --add Microsoft.VisualStudio.Component.Static.Analysis.Tools'
+               ' --add Microsoft.VisualStudio.Component.VC.CMake.Project'
+               ' --add Microsoft.VisualStudio.Component.VC.140'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.Desktop'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.UWP'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.UWP.Native'
+               ' --add Microsoft.VisualStudio.ComponentGroup.Windows10SDK.15063'
+               ' --wait'
+               ' --passive'
+               ' --norestart'
+               )
+
+    if ret == 3010 or ret == 0:
+        # 3010 is restart required
+        logging.info("VS install successful.")
+    else:
+        raise RuntimeError("VS failed to install, exit status {}".format(ret))
+    # Workaround for --wait sometimes ignoring the subprocesses doing component installs
+
+    def vs_still_installing():
+        return {'vs_installer.exe', 'vs_installershell.exe', 'vs_setup_bootstrapper.exe'} & set(map(lambda process: process.name(), psutil.process_iter()))
+    timer = 0
+    while vs_still_installing() and timer < DEFAULT_SUBPROCESS_TIMEOUT:
+        logging.warning("VS installers still running for %d s", timer)
+        if timer % 60 == 0:
+            logging.info("Waiting for Visual Studio to install for the last {} seconds".format(str(timer)))
+        sleep(1)
+        timer += 1
+    if vs_still_installing():
+        logging.warning("VS install still running after timeout (%d)", DEFAULT_SUBPROCESS_TIMEOUT)
+    else:
+        logging.info("Visual studio install complete.")
+
+
+def install_cmake():
+    logging.info("Installing CMAKE")
+    cmake_file_path = download(DEPS['cmake'], '.')
+    check_call(['msiexec ', '/n', '/passive', '/i', cmake_file_path])
+    logging.info("CMAKE install complete")
+
+
+def install_perl():
+    logging.info("Installing Perl")
+    with tempfile.TemporaryDirectory() as tmpdir:
+        perl_file_path = download(DEPS['perl'], tmpdir)
+        check_call(['msiexec ', '/n', '/passive', '/i', perl_file_path])
+    logging.info("Perl install complete")
+
+
+def install_clang():
 
 Review comment:
   Why do we need clang when compiling with visual studio?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402547355
 
 

 ##########
 File path: CMakeLists.txt
 ##########
 @@ -163,6 +163,8 @@ if(MSVC)
   add_definitions(-DDMLC_STRICT_CXX11)
   add_definitions(-DNOMINMAX)
   set(CMAKE_C_FLAGS "/MP")
+  # report an accurate value for recent C++ language standards support
+  set(CMAKE_CXX_FLAGS "/Zc:__cplusplus")
 
 Review comment:
   set(flag ${flag} "secondval") does append right?
   I thought we are appending to CMAKE_CXX_FLAGS

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
marcoabreu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402562836
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -253,12 +284,8 @@ def main():
     system = platform.system()
     if system == 'Windows':
         logging.info("Detected Windows platform")
-        if 'OpenBLAS_HOME' not in os.environ:
-            os.environ["OpenBLAS_HOME"] = "C:\\Program Files\\OpenBLAS-v0.2.19"
-        if 'OpenCV_DIR' not in os.environ:
-            os.environ["OpenCV_DIR"] = "C:\\Program Files\\OpenCV-v3.4.1\\build"
         if 'CUDA_PATH' not in os.environ:
-            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2"
+            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2"
 
 Review comment:
   We didn't agree on increasing the minimum cuda version

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] marcoabreu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
marcoabreu commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605609680
 
 
   I'll have a look at the logs when I'm at my computer 
   
   Just to be clear about two things:
   1. Retries are fine for now, but must be removed before merging.
   2. It is not an option to remove GPU mkldnn. It does make sense for cases where an operator is not supported by the GPU or the user wants to run some parts on CPU. Just because it breaks, it doesn't mean that we can remove it to ease our situation. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605878153
 
 
   @marcoabreu Also, after adding the retries, from build #18 to #22 all 5 have passed on WIN_GPU and WIN_GPU_MKLDNN compilation stage. That's a compeling reason for using retries to temporarily resolve the intermittent failure I feel.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605447906
 
 
   WIN_GPU_MKLDNN is having an issue similar to https://github.com/pytorch/pytorch/issues/25393

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] josephevans commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
josephevans commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r401357878
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -193,14 +238,19 @@ def windows_package(args):
         for dll in dlls:
             logging.info("packing dll: %s", dll)
             shutil.copy(dll, pkgdir_lib)
+
+        if pkgdir_lib.find('gpu') != -1:
+            add_path("C:\\jenkins_slave\\workspace\\ut-python-gpu\\windows_package\\lib")
 
 Review comment:
   Updating the path should be done in the testing phase - in ci/windows/test_py3_gpu.ps1 so the tests can find all the DLLs.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r403124649
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -253,12 +284,8 @@ def main():
     system = platform.system()
     if system == 'Windows':
         logging.info("Detected Windows platform")
-        if 'OpenBLAS_HOME' not in os.environ:
-            os.environ["OpenBLAS_HOME"] = "C:\\Program Files\\OpenBLAS-v0.2.19"
-        if 'OpenCV_DIR' not in os.environ:
-            os.environ["OpenCV_DIR"] = "C:\\Program Files\\OpenCV-v3.4.1\\build"
         if 'CUDA_PATH' not in os.environ:
-            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2"
+            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2"
 
 Review comment:
   https://devblogs.microsoft.com/cppblog/cuda-10-1-available-now-with-support-for-latest-microsoft-visual-studio-2019-versions/

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-607061503
 
 
   @leezu seems like adding both 5.2 and 7.0 and then drop 7.0 would trigger a normal run...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r397595244
 
 

 ##########
 File path: ci/windows_dev_env/windows_deps_headless_installer.py
 ##########
 @@ -0,0 +1,429 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+"""Dependency installer for Windows"""
+
+__author__ = 'Pedro Larroy, Chance Bair'
+__version__ = '0.2'
+
+import argparse
+import errno
+import logging
+import os
+import psutil
+import shutil
+import subprocess
+import urllib
+import stat
+import tempfile
+import zipfile
+from time import sleep
+from urllib.error import HTTPError
+import logging
+from subprocess import check_output, check_call, call
+import re
+import sys
+import urllib.request
+import contextlib
+
+import ssl
+
+ssl._create_default_https_context = ssl._create_unverified_context
+
+log = logging.getLogger(__name__)
+
+
+DEPS = {
+    'openblas': 'https://windows-post-install.s3-us-west-2.amazonaws.com/OpenBLAS-windows-v0_2_19.zip',
+    'opencv': 'https://windows-post-install.s3-us-west-2.amazonaws.com/opencv-windows-4.1.2-vc14_vc15.zip',
+    'cudnn': 'https://windows-post-install.s3-us-west-2.amazonaws.com/cudnn-9.2-windows10-x64-v7.4.2.24.zip',
+    'nvdriver': 'https://windows-post-install.s3-us-west-2.amazonaws.com/nvidia_display_drivers_398.75_server2016.zip',
+    'perl': 'http://strawberryperl.com/download/5.30.1.1/strawberry-perl-5.30.1.1-64bit.msi',
+    'clang': 'https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/LLVM-9.0.1-win64.exe',
+    # This installation of CMake breaks windows PATH when executing vcvars, installing from
+    # chocolatey from powershell instead.
+    'cmake': 'https://github.com/Kitware/CMake/releases/download/v3.16.2/cmake-3.16.2-win64-x64.msi'
+}
+
+DEFAULT_SUBPROCESS_TIMEOUT = 3600
+
+
+@contextlib.contextmanager
+def remember_cwd():
+    '''
+    Restore current directory when exiting context
+    '''
+    curdir = os.getcwd()
+    try:
+        yield
+    finally:
+        os.chdir(curdir)
+
+
+def retry(target_exception, tries=4, delay_s=1, backoff=2):
+    """Retry calling the decorated function using an exponential backoff.
+
+    http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/
+    original from: http://wiki.python.org/moin/PythonDecoratorLibrary#Retry
+
+    :param target_exception: the exception to check. may be a tuple of
+        exceptions to check
+    :type target_exception: Exception or tuple
+    :param tries: number of times to try (not retry) before giving up
+    :type tries: int
+    :param delay_s: initial delay between retries in seconds
+    :type delay_s: int
+    :param backoff: backoff multiplier e.g. value of 2 will double the delay
+        each retry
+    :type backoff: int
+    """
+    import time
+    from functools import wraps
+
+    def decorated_retry(f):
+        @wraps(f)
+        def f_retry(*args, **kwargs):
+            mtries, mdelay = tries, delay_s
+            while mtries > 1:
+                try:
+                    return f(*args, **kwargs)
+                except target_exception as e:
+                    logging.warning("Exception: %s, Retrying in %d seconds...", str(e), mdelay)
+                    time.sleep(mdelay)
+                    mtries -= 1
+                    mdelay *= backoff
+            return f(*args, **kwargs)
+
+        return f_retry  # true decorator
+
+    return decorated_retry
+
+
+@retry((ValueError, OSError, HTTPError), tries=5, delay_s=2, backoff=5)
+def download(url, dest=None, progress=False) -> str:
+    from urllib.request import urlopen
+    from urllib.parse import (urlparse, urlunparse)
+    import progressbar
+    import http.client
+
+    class ProgressCB():
+        def __init__(self):
+            self.pbar = None
+
+        def __call__(self, block_num, block_size, total_size):
+            if not self.pbar and total_size > 0:
+                self.pbar = progressbar.bar.ProgressBar(max_value=total_size)
+            downloaded = block_num * block_size
+            if self.pbar:
+                if downloaded < total_size:
+                    self.pbar.update(downloaded)
+                else:
+                    self.pbar.finish()
+    if dest and os.path.isdir(dest):
+        local_file = os.path.split(urlparse(url).path)[1]
+        local_path = os.path.normpath(os.path.join(dest, local_file))
+    else:
+        local_path = dest
+    with urlopen(url) as c:
+        content_length = c.getheader('content-length')
+        length = int(content_length) if content_length and isinstance(c, http.client.HTTPResponse) else None
+        if length and local_path and os.path.exists(local_path) and os.stat(local_path).st_size == length:
+            log.debug(f"download('{url}'): Already downloaded.")
+            return local_path
+    log.debug(f"download({url}, {local_path}): downloading {length} bytes")
+    if local_path:
+        with tempfile.NamedTemporaryFile(delete=False) as tmpfd:
+            urllib.request.urlretrieve(url, filename=tmpfd.name, reporthook=ProgressCB() if progress else None)
+            shutil.move(tmpfd.name, local_path)
+    else:
+        (local_path, _) = urllib.request.urlretrieve(url, reporthook=ProgressCB())
+    log.debug(f"download({url}, {local_path}'): done.")
+    return local_path
+
+
+# Takes arguments and runs command on host.  Shell is disabled by default.
+# TODO: Move timeout to args
+def run_command(*args, shell=False, timeout=DEFAULT_SUBPROCESS_TIMEOUT, **kwargs):
+    try:
+        logging.info("Issuing command: {}".format(args))
+        res = subprocess.check_output(*args, shell=shell, timeout=timeout).decode("utf-8").replace("\r\n", "\n")
+        logging.info("Output: {}".format(res))
+    except subprocess.CalledProcessError as e:
+        raise RuntimeError("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
+    return res
+
+
+# Copies source directory recursively to destination.
+def copy(src, dest):
+    try:
+        shutil.copytree(src, dest)
+        logging.info("Moved {} to {}".format(src, dest))
+    except OSError as e:
+        # If the error was caused because the source wasn't a directory
+        if e.errno == errno.ENOTDIR:
+            shutil.copy(src, dest)
+            logging.info("Moved {} to {}".format(src, dest))
+        else:
+            raise RuntimeError("copy return with error: {}".format(e))
+
+
+# Workaround for windows readonly attribute error
+def on_rm_error(func, path, exc_info):
+    # path contains the path of the file that couldn't be removed
+    # let's just assume that it's read-only and unlink it.
+    os.chmod(path, stat.S_IWRITE)
+    os.unlink(path)
+
+
+def install_vs():
+    # Visual Studio CE 2017
+    # Path: C:\Program Files (x86)\Microsoft Visual Studio 14.0
+    # Components: https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2017#visual-studio-core-editor-included-with-visual-studio-community-2017
+    logging.info("Installing Visual Studio CE 2017...")
+    vs_file_path = download('https://aka.ms/eac464')
+    run_command("PowerShell Rename-Item -Path {} -NewName \"{}.exe\"".format(vs_file_path,
+                                                                             vs_file_path.split('\\')[-1]), shell=True)
+    vs_file_path = vs_file_path + '.exe'
+    ret = call(vs_file_path +
+               ' --add Microsoft.VisualStudio.Workload.ManagedDesktop'
+               ' --add Microsoft.VisualStudio.Workload.NetCoreTools'
+               ' --add Microsoft.VisualStudio.Workload.NetWeb'
+               ' --add Microsoft.VisualStudio.Workload.Node'
+               ' --add Microsoft.VisualStudio.Workload.Office'
+               ' --add Microsoft.VisualStudio.Component.TypeScript.2.0'
+               ' --add Microsoft.VisualStudio.Component.TestTools.WebLoadTest'
+               ' --add Component.GitHub.VisualStudio'
+               ' --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core'
+               ' --add Microsoft.VisualStudio.Component.Static.Analysis.Tools'
+               ' --add Microsoft.VisualStudio.Component.VC.CMake.Project'
+               ' --add Microsoft.VisualStudio.Component.VC.140'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.Desktop'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.UWP'
+               ' --add Microsoft.VisualStudio.Component.Windows10SDK.15063.UWP.Native'
+               ' --add Microsoft.VisualStudio.ComponentGroup.Windows10SDK.15063'
+               ' --wait'
+               ' --passive'
+               ' --norestart'
+               )
+
+    if ret == 3010 or ret == 0:
+        # 3010 is restart required
+        logging.info("VS install successful.")
+    else:
+        raise RuntimeError("VS failed to install, exit status {}".format(ret))
+    # Workaround for --wait sometimes ignoring the subprocesses doing component installs
+
+    def vs_still_installing():
+        return {'vs_installer.exe', 'vs_installershell.exe', 'vs_setup_bootstrapper.exe'} & set(map(lambda process: process.name(), psutil.process_iter()))
+    timer = 0
+    while vs_still_installing() and timer < DEFAULT_SUBPROCESS_TIMEOUT:
+        logging.warning("VS installers still running for %d s", timer)
+        if timer % 60 == 0:
+            logging.info("Waiting for Visual Studio to install for the last {} seconds".format(str(timer)))
+        sleep(1)
+        timer += 1
+    if vs_still_installing():
+        logging.warning("VS install still running after timeout (%d)", DEFAULT_SUBPROCESS_TIMEOUT)
+    else:
+        logging.info("Visual studio install complete.")
+
+
+def install_cmake():
+    logging.info("Installing CMAKE")
+    cmake_file_path = download(DEPS['cmake'], '.')
+    check_call(['msiexec ', '/n', '/passive', '/i', cmake_file_path])
+    logging.info("CMAKE install complete")
+
+
+def install_perl():
+    logging.info("Installing Perl")
+    with tempfile.TemporaryDirectory() as tmpdir:
+        perl_file_path = download(DEPS['perl'], tmpdir)
+        check_call(['msiexec ', '/n', '/passive', '/i', perl_file_path])
+    logging.info("Perl install complete")
+
+
+def install_clang():
+    logging.info("Installing Clang")
+    with tempfile.TemporaryDirectory() as tmpdir:
+        clang_file_path = download(DEPS['clang'], tmpdir)
+        run_command(clang_file_path + " /S /D=C:\\Program Files\\LLVM")
+    logging.info("Clang install complete")
+
+
+def install_openblas():
+    logging.info("Installing OpenBLAS")
+    local_file = download(DEPS['openblas'])
+    with zipfile.ZipFile(local_file, 'r') as zip:
+        zip.extractall("C:\\Program Files")
+    run_command("PowerShell Set-ItemProperty -path 'hklm:\\system\\currentcontrolset\\control\\session manager\\environment' -Name OpenBLAS_HOME -Value 'C:\\Program Files\\OpenBLAS-windows-v0_2_19'")
+    logging.info("Openblas Install complete")
+
+
+def install_mkl():
+    logging.info("Installing MKL 2019.3.203...")
+    file_path = download("http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15247/w_mkl_2019.3.203.exe")
+    run_command("{} --silent --remove-extracted-files yes --a install -output=C:\mkl-install-log.txt -eula=accept".format(file_path))
+    logging.info("MKL Install complete")
+
+
+def install_opencv():
+    logging.info("Installing OpenCV")
+    with tempfile.TemporaryDirectory() as tmpdir:
+        local_file = download(DEPS['opencv'])
+        with zipfile.ZipFile(local_file, 'r') as zip:
+            zip.extractall(tmpdir)
+        copy(f'{tmpdir}\\opencv\\build', r'c:\Program Files\opencv')
+
+    run_command("PowerShell Set-ItemProperty -path 'hklm:\\system\\currentcontrolset\\control\\session manager\\environment' -Name OpenCV_DIR -Value 'C:\\Program Files\\opencv'")
+    logging.info("OpenCV install complete")
+
+
+def install_cudnn():
+    # cuDNN
+    logging.info("Installing cuDNN")
+    with tempfile.TemporaryDirectory() as tmpdir:
+        local_file = download(DEPS['cudnn'])
+        with zipfile.ZipFile(local_file, 'r') as zip:
+            zip.extractall(tmpdir)
+        copy(tmpdir+"\\cuda\\bin\\cudnn64_7.dll", "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2\\bin")
+        copy(tmpdir+"\\cuda\\include\\cudnn.h", "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2\\include")
+        copy(tmpdir+"\\cuda\\lib\\x64\\cudnn.lib", "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2\\lib\\x64")
+    logging.info("cuDNN install complete")
+
+
+def install_gpu_driver(force=False):
+    if has_gpu() or force:
+        logging.info("GPU detected")
+        install_nvdriver()
+
+
+def install_nvdriver():
+    logging.info("Installing Nvidia Display Drivers...")
+    with tempfile.TemporaryDirectory(prefix='nvidia drivers') as tmpdir:
+        local_file = download(DEPS['nvdriver'])
+        with zipfile.ZipFile(local_file, 'r') as zip:
+            zip.extractall(tmpdir)
+        with remember_cwd():
+            os.chdir(tmpdir)
+            check_call(".\setup.exe -noreboot -clean -noeula -nofinish -passive")
+    logging.info("NVidia install complete")
+
+
+def install_cuda():
+    # CUDA 9.2 and patches
 
 Review comment:
   CUDA is updated to 10.2 now.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera edited a comment on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605572269
 
 
   > @vexilligera as discussed offline, lets try testing locally for WIN_GPU and WIN_GPU_MKLDNN build 10 times each (since 1 run takes 20-30mins) to come up with some basis... (ideally would have tried 100 times but given the resource & time constraints)
   
   On my local test, the WIN_GPU_MKLDNN is much more flaky than WIN_GPU, as all WIN_GPU builds passed while about 1/3 of WIN_GPU_MKLDNN builds failed, based on my historical test data.
   
   @haojin2 suggests us removing the WIN_GPU_MKLDNN test entirely since MKLDNN doesn't make much sense as we are running on GPU, and GPU_MKLDNN case is covered on other platforms.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] larroy commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
larroy commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r398837420
 
 

 ##########
 File path: ci/windows_dev_env/windows_deps_headless_installer.py
 ##########
 @@ -0,0 +1,429 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+"""Dependency installer for Windows"""
+
+__author__ = 'Pedro Larroy, Chance Bair'
+__version__ = '0.2'
+
+import argparse
+import errno
+import logging
+import os
+import psutil
+import shutil
+import subprocess
+import urllib
+import stat
+import tempfile
+import zipfile
+from time import sleep
+from urllib.error import HTTPError
+import logging
+from subprocess import check_output, check_call, call
+import re
+import sys
+import urllib.request
+import contextlib
+
+import ssl
+
+ssl._create_default_https_context = ssl._create_unverified_context
+
+log = logging.getLogger(__name__)
+
+
+DEPS = {
+    'openblas': 'https://windows-post-install.s3-us-west-2.amazonaws.com/OpenBLAS-windows-v0_2_19.zip',
+    'opencv': 'https://windows-post-install.s3-us-west-2.amazonaws.com/opencv-windows-4.1.2-vc14_vc15.zip',
+    'cudnn': 'https://windows-post-install.s3-us-west-2.amazonaws.com/cudnn-9.2-windows10-x64-v7.4.2.24.zip',
+    'nvdriver': 'https://windows-post-install.s3-us-west-2.amazonaws.com/nvidia_display_drivers_398.75_server2016.zip',
 
 Review comment:
   mxnet-ci-dev

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
vexilligera commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402674422
 
 

 ##########
 File path: CMakeLists.txt
 ##########
 @@ -163,6 +163,8 @@ if(MSVC)
   add_definitions(-DDMLC_STRICT_CXX11)
   add_definitions(-DNOMINMAX)
   set(CMAKE_C_FLAGS "/MP")
+  # report an accurate value for recent C++ language standards support
+  set(CMAKE_CXX_FLAGS "/Zc:__cplusplus")
 
 Review comment:
   My bad. I thought it would append...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
ChaiBapchya commented on issue #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#issuecomment-605210789
 
 
   retriggering.. windows

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: [WIP] Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r402557234
 
 

 ##########
 File path: ci/build_windows.py
 ##########
 @@ -253,12 +284,8 @@ def main():
     system = platform.system()
     if system == 'Windows':
         logging.info("Detected Windows platform")
-        if 'OpenBLAS_HOME' not in os.environ:
-            os.environ["OpenBLAS_HOME"] = "C:\\Program Files\\OpenBLAS-v0.2.19"
-        if 'OpenCV_DIR' not in os.environ:
-            os.environ["OpenCV_DIR"] = "C:\\Program Files\\OpenCV-v3.4.1\\build"
         if 'CUDA_PATH' not in os.environ:
-            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.2"
+            os.environ["CUDA_PATH"] = "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2"
 
 Review comment:
   What is your concern?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on a change in pull request #17808: Windows dev environment configuration, update install instructions from source in the docs

Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #17808: Windows dev environment configuration, update install instructions from source in the docs
URL: https://github.com/apache/incubator-mxnet/pull/17808#discussion_r390728074
 
 

 ##########
 File path: docs/static_site/src/pages/get_started/windows_setup.md
 ##########
 @@ -137,126 +137,37 @@ Check the chart below for other options or refer to [PyPI for other MXNet pip pa
 
 ## Build from Source
 
-**IMPORTANT: It is recommended that you review the [build from source guide](build_from_source) first.** It describes many of the build options that come with MXNet in more detail. You may decide to install additional dependencies and modify your build flags after reviewing this material.
 
-We provide two primary options to build and install MXNet yourself using [Microsoft Visual Studio 2017](https://www.visualstudio.com/downloads/) or [Microsoft Visual Studio 2015](https://www.visualstudio.com/vs/older-downloads/).
+For automated setting up of developer environment in windows, use script bundle from the
+![ci/windows_dev_env](https://github.com/apache/incubator-mxnet/tree/master/ci/windows_dev_env/)
+folder. Copy to a local directory and execute:
 
-**NOTE:** Visual Studio 2017's compiler is `vc15`. This is not to be confused with Visual Studio 2015's compiler, `vc14`.
-
-You also have the option to install MXNet with MKL or MKL-DNN. In this case it is recommended that you refer to the [MKLDNN_README](https://mxnet.apache.org/api/python/docs/tutorials/performance/backend/mkldnn/mkldnn_readme.html).
-
-**Option 1: Build with Microsoft Visual Studio 2017 (VS2017)**
-
-To build and install MXNet yourself using [VS2017](https://www.visualstudio.com/downloads/), you need the following dependencies. You may try a newer version of a particular dependency, but please open a pull request or [issue](https://github.com/apache/incubator-mxnet/issues/new) to update this guide if a newer version is validated.
-
-1. Install or update VS2017.
-    - If [VS2017](https://www.visualstudio.com/downloads/) is not already installed, download and install it. You can download and install the free community edition.
-    - When prompted about installing Git, go ahead and install it.
-    - If VS2017 is already installed you will want to update it. Proceed to the next step to modify your installation. You will be given the opportunity to update VS2017 as well
-1. Follow the [instructions for opening the Visual Studio Installer](https://docs.microsoft.com/en-us/visualstudio/install/modify-visual-studio) to modify `Individual components`.
-1. Once in the Visual Studio Installer application, update as needed, then look for and check `VC++ 2017 version 15.4 v14.11 toolset`, and click `Modify`.
-1. Change the version of the Visual studio 2017 to v14.11 using the following command (by default the VS2017 is installed in the following path):
-```
-"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.11
-```
-1. Download and install [CMake](https://cmake.org/download) if it is not already installed. [CMake v3.12.2](https://cmake.org/files/v3.12/cmake-3.12.2-win64-x64.msi) has been tested with MXNet.
-1. Download and run the  [OpenCV](https://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.4.1/opencv-3.4.1-vc14_vc15.exe/download) package. There are more recent versions of OpenCV, so please create an issue/PR to update this info if you validate one of these later versions.
-1. This will unzip several files. You can place them in another directory if you wish. We will use `C:\utils`(```mkdir C:\utils```) as our default path.
-1. Set the environment variable `OpenCV_DIR` to point to the OpenCV build directory that you just unzipped. Start ```cmd``` and type `set OpenCV_DIR=C:\utils\opencv\build`.
-1. If you don’t have the Intel Math Kernel Library (MKL) installed, you can install it and follow the [MKLDNN_README](https://mxnet.apache.org/api/python/docs/tutorials/performance/backend/mkldnn/mkldnn_readme.html) from here, or you can use OpenBLAS. These instructions will assume you're using OpenBLAS.
-1. Download the [OpenBlas](https://sourceforge.net/projects/openblas/files/v0.2.19/OpenBLAS-v0.2.19-Win64-int32.zip/download) package. Later versions of OpenBLAS are available, but you would need to build from source. v0.2.19 is the most recent version that ships with binaries. Contributions of more recent binaries would be appreciated.
-1. Unzip the file, rename it to ```OpenBLAS``` and put it under `C:\utils`. You can place the unzipped files and folders in another directory if you wish.
-1. Set the environment variable `OpenBLAS_HOME` to point to the OpenBLAS directory that contains the `include` and `lib` directories and type `set OpenBLAS_HOME=C:\utils\OpenBLAS` on the command prompt(```cmd```).
-1. Download and install [CUDA](https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal). If you already had CUDA, then installed VS2017, you should reinstall CUDA now so that you get the CUDA toolkit components for VS2017 integration. Note that the latest CUDA version supported by MXNet is [9.2](https://developer.nvidia.com/cuda-92-download-archive). You might also want to find other CUDA verion on the [Legacy Releases](https://developer.nvidia.com/cuda-toolkit-archive).
-1. Download and install cuDNN. To get access to the download link, register as an NVIDIA community user. Then follow the [link](http://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#install-windows) to install the cuDNN and put those libraries into ```C:\cuda```.
-1. Download and install [git](https://git-for-windows.github.io/) if you haven't already.
-
-After you have installed all of the required dependencies, build the MXNet source code:
-
-1. Start ```cmd``` in windows.
-2. Download the MXNet source code from GitHub by using following command:
-```
-cd C:\
-git clone https://github.com/apache/incubator-mxnet.git --recursive
-```
-3. Verify that the `DCUDNN_INCLUDE` and `DCUDNN_LIBRARY` environment variables are pointing to the `include` folder and `cudnn.lib` file of your CUDA installed location, and `C:\incubator-mxnet` is the location of the source code you just cloned in the previous step.
-4. Create a build dir using the following command and go to the directory, for example:
-```
-mkdir C:\incubator-mxnet\build
-cd C:\incubator-mxnet\build
-```
-5. Compile the MXNet source code with `cmake` by using following command:
 ```
-cmake -G "Visual Studio 15 2017 Win64" -T cuda=9.2,host=x64 -DUSE_CUDA=1 -DUSE_CUDNN=1 -DUSE_NVRTC=1 -DUSE_OPENCV=1 -DUSE_OPENMP=1 -DUSE_BLAS=open -DUSE_LAPACK=1 -DUSE_DIST_KVSTORE=0 -DCUDA_ARCH_LIST=Common -DCUDA_TOOLSET=9.2 -DCUDNN_INCLUDE=C:\cuda\include -DCUDNN_LIBRARY=C:\cuda\lib\x64\cudnn.lib "C:\incubator-mxnet"
+.\setup.ps1
 
 Review comment:
   Is it feasible to provide short non-blackbox instructions to install MXNet?
   
   For example, if users have a standard installation of visual studio, can the installation experience be pretty similar to https://mxnet.apache.org/get_started/ubuntu_setup#build-the-mxnet-shared-library-from-source Step 2 and Step 3?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services