Rebuilding Mxnet

In case I want to edit in mxnet source code, how can I recompile it and make sure that I am using the built version not the pip installed one?

While building mxnet from source using the provided command
make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1
I get this
src/operator/tensor/./elemwise_binary_op-inl.h:253:1: internal compiler error: Segmentation fault
Please submit a full bug report

It kept compiling and then the make was stopped with this message.
The bug is not reproducible, so it is likely a hardware or OS problem.

Given that it is properly installed using pip

Hi! You might find the wiki to have some valuable info for started to dev with MXNet’s source.
https://cwiki.apache.org/confluence/display/MXNET/Development+Process

I’ll assume you’re using Ubuntu and have installed the CUDA and cuDNN software already. If this is the case, I really like to use this script to setup my dev env (it works on a CPU-only system too though):
https://github.com/apache/incubator-mxnet/tree/master/docs#how-to-build-the-mxnet-website-for-development-and-qa

It has essentially the same command you used, but it’s making sure you’ve got all of your dependencies installed first.

I don’t really use the pip package installation if I’m tinkering with the source code. I suppose you could if you’re just changing the python files. In this case you might want to try:

  1. Install it from source code and make your changes executable with this command:
    pip install -e .

  2. To upgrade from source code and make changes executable, run:
    pip install -U -e .