Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

added mac gpu install; refactored windows install #9353

Merged
merged 4 commits into from
Jan 18, 2018

Conversation

aaronmarkham
Copy link
Contributor

@aaronmarkham aaronmarkham commented Jan 9, 2018

Description

  • Fixed install selector issues where certain Windows instructions were failing to appear.
  • Added Mac OS GPU installation info

The install page is far from ideal - super difficult to maintain - but this should at least improve usability.

Checklist

Essentials

  • Passed code style checking (make lint)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
    Out of the scope of this PR.
  • Code is well-documented:
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Windows
    • Fixed config so Windows pip, virtualenv, docker, and build from source selector appears.
    • Windows > Python > GPU > build from source instructions are available now under the appropriate heading.
    • Windows > Python > CPU > pip install added
  • Mac
    • Mac > Python > GPU > Build from Source - Added Mac OS X GPU build from source instructions.
  • Various adjustments to repair validation sections.

Comments

Documents #9217 for at least a non-OpenCV build. Mac + GPU + OpenCV is uncertain.
Fixes #9146 (broken selector)

Existing PR #8619 - will need to rebase with this update and should probably just add updated installation info to the existing section in this file instead of the separate windows_setup.md file.

Windows CPU Build From Source needs validation and improved information since the existing docs really seem to focus on GPU builds only.

@szha
Copy link
Member

szha commented Jan 9, 2018

@JulianSlzr could you help review?

3. Run `xcode-select --install` to install all command line tools, compilers, etc.

4. Install CUDA for MacOS X. Specific steps are provided in NVIDIA's [CUDA installation instructions](https://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html#installation).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One must install cuDNN 7 for CUDA 9.1 separately. Link to http://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#installmac and note that one will need to create a (free) NVIDIA account.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll add some more helpful links for these steps.


8. Copy the `mxnet/make/osx.mk` to `mxnet/config.mk`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Work relative to being in mxnet/, e.g., "Copy make/osx.mk to config.mk in the MXNet root directory."

USE_CUDA = 1
USE_CUDA_PATH = /usr/local/cuda
USE_CUDNN = 1
USE_OPENCV = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users will probably be interested in using OpenCV (we don't even mention it as optional in the Linux instructions). Mention that one could do this if one has Homebrew, via brew tap homebrew/science; brew install opencv.

In general, the install won't go through unless you have brew or port installed, along with dependencies like numpy (which most users on the issue have implicitly done). I can confirm this on my own Mac+GPU install.

Really, the right thing to do would be to either:

  1. Tell the user to edit the build script we have for Mac OS X > CPU > Build from Source
  2. Roll a modified build script that sets environment variables then calls the build script above
  3. Be very explicit about packages we need to install, which is what we do for the Linux docs anyways. That is, go back to something like what we had in the past (https://mxnet.incubator.apache.org/get_started/osx_setup.html)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to have this conversation along with the source of these instructions: #9217
I was mostly trying to get the latest validated instructions presented and have the install selector actually work.
Also, I purposely avoided OpenCV because it is a can of worms and instructions depend on the version you want, so, overall, it can be a royal pain to get working, whereas a GPU build without OpenCV is much more easily attained.
Happy to add it if there is a validated build chain with specific versions of it mentioned. I'm afraid just switching to use_opencv=1 may break these instructions.
Regarding the custom script - again, that needs to be verified, and the old getting started seems pretty out of date... whereas this recent issue seems to be more current.
I think we should make a note of it and provide the brew instructions, but let this pass for now until we have validated instructions for opencv or a custom install script.

8. Copy the `mxnet/make/osx.mk` to `mxnet/config.mk`

9. Run `make`. If you previously attempted to compile you might want to do make clean_all first. You can also run `make -j` with the number of processors you have to compile with multithreading. There'll be plenty of warnings, but there should be no errors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write make clean_all (i.e., with backticks)

9. Run `make`. If you previously attempted to compile you might want to do make clean_all first. You can also run `make -j` with the number of processors you have to compile with multithreading. There'll be plenty of warnings, but there should be no errors.

10. Once finished, you should have a file called `libmxnet.so` in `mxnet/lib/`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...in lib/ (i.e., work relative from mxnet/)

Next, we install ```graphviz``` library that we use for visualizing network graphs you build on MXNet. We will also install [Jupyter Notebook](http://jupyter.readthedocs.io/) used for running MXNet tutorials and examples.
- Install ```graphviz``` by downloading MSI installer from [Graphviz Download Page](https://graphviz.gitlab.io/_pages/Download/Download_windows.html).
**Note** Make sure to add graphviz executable path to PATH environment variable. Refer [here for more details](http://stackoverflow.com/questions/35064304/runtimeerror-make-sure-the-graphviz-executables-are-on-your-systems-path-aft)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definite articles! E.g., the graphviz library, ... the MSI installer, ... the graphviz executable, ... the PATH environment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure... this was all pre-existing content that I didn't really focus on, but let's fix it now!

@szha
Copy link
Member

szha commented Jan 14, 2018

@aaronmarkham would you address the review comments?

@eric-haibin-lin
Copy link
Member

@JulianSlzr is this good to go?

@szha
Copy link
Member

szha commented Jan 17, 2018

@JulianSlzr mentioned that he would do a trial run and get back to us.

Copy link
Contributor

@JulianSlzr JulianSlzr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did the GPU install on a clean machine. My revisions somewhat differ from #9217 since users there aren't fully using brew, from which e.g., opencv can be installed. [This is why I do pip install instead of using python setup.py for example, as the latter will cryptically fail (numpy's setup script isn't great on macOS; using pip forces a .whl download).]

Anyways, this is more consistent w/ the macOS CPU script and the Linux instructions. (Props to @poohlty for lending me his 2012 NVIDIA-powered MacBook.)

$ export PATH=/usr/local/bin:/usr/local/sbin:$PATH

# Install python development tools - python2.7, pip, python-setuptools
$ brew install python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the full line brew install python pkg-config graphviz

@@ -709,28 +732,32 @@ Alternatively, you may follow the [CUDA installation instructions for Mac OS X](

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add step: Run sudo xcodebuild -license accept to accept Xcode's licensing terms.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.


12. Run `sudo python setup.py install`.
8. Run `sudo python setup.py install`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace this with sudo pip install -e . (note that the . is part of the command). You could furthermore copy the blurb that says "Note that the -e flag is optional" etc. from the Linux instructions.

```

**Step 3** Install CUDA and cuDNN

The following instructions are for CUDA 9.1 and cuDNN 7 for MacOS X 10.12+ and a CUDA-capable GPU. They summarize confirmed successful builds in [#9217](https://github.com/apache/incubator-mxnet/issues/9217).
Alternatively, you may follow the [CUDA installation instructions for Mac OS X](https://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The direct URL to Xcode 8.3.3 below will silently fail if you're not logged in. Better to link to https://developer.apple.com/download/more/, as it'll prompt you if you need to log in with your Apple ID.

@@ -709,28 +732,32 @@ Alternatively, you may follow the [CUDA installation instructions for Mac OS X](

4. Install CUDA for MacOS X. Specific steps are provided in NVIDIA's [CUDA installation instructions](https://docs.nvidia.com/cuda/cuda-installation-guide-mac-os-x/index.html#installation).

5. Run `git clone --recursive https://github.com/apache/incubator-mxnet.git mxnet` to get the latest version.
5. [Download](http://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#download-mac) and [install](http://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#installmac) cuDNN for MacOS X. You will need to [create a free developer account](https://developer.nvidia.com/accelerated-computing-developer) with NVIDIA prior to getting the download link.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently, it's just "macOS" these days (I noticed the CPU instructions already did this). Let's replace the various instances of "MacOS X" / "Mac OS X" with that. Sorry!

@JulianSlzr
Copy link
Contributor

Thanks for the changes, looks good to me.

@eric-haibin-lin eric-haibin-lin merged commit 55ce97c into apache:master Jan 18, 2018
larroy pushed a commit to larroy/mxnet that referenced this pull request Jan 19, 2018
* added mac gpu install; refactored windows install

* resolving comments

* resolving comments on mac install

* added ticks for a xcode-select command
@aaronmarkham aaronmarkham deleted the mac-gpu branch January 22, 2018 21:38
yuxiangw pushed a commit to yuxiangw/incubator-mxnet that referenced this pull request Jan 25, 2018
* added mac gpu install; refactored windows install

* resolving comments

* resolving comments on mac install

* added ticks for a xcode-select command
rahul003 pushed a commit to rahul003/mxnet that referenced this pull request Jun 4, 2018
* added mac gpu install; refactored windows install

* resolving comments

* resolving comments on mac install

* added ticks for a xcode-select command
zheng-da pushed a commit to zheng-da/incubator-mxnet that referenced this pull request Jun 28, 2018
* added mac gpu install; refactored windows install

* resolving comments

* resolving comments on mac install

* added ticks for a xcode-select command
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Install instructions - selector broken
4 participants