I have been trying to get a PyTorch version built from source which I can use for contributing for quite a while now.
I’m cloning the repo and running python setup.py develop inside a designated anaconda environment. The build proceeds without errors. However, my problem is that I can never get the tests in test/run_test.sh to pass.
Since I’m out of ideas, I’m currently trying to eliminate all warnings I get during the build process. The rationale is that hopefully once this works, the tests will also succeed.
Currently, I’m stuck with the following warnings for which I couldn’t find a satisfactory answer after googling. I have ommitted warnings which I think are unsubstantial for now.




CMake Warning at /home/user/miniconda3/envs/torchdev37/lib/python3.7/site-packages/pybind11/share/cmake/pybind11/pybind11Tools.cmake:19 (message):
  Set PYBIND11_PYTHON_VERSION to search for a specific version, not
  PYTHON_VERSION (which is an output).  Assuming that is what you meant to do
  and continuing anyway.

I installed pybind via pip inside my Miniconda environment. I’m not sure what I’m supposed to do here.




CMake Warning at cmake/External/nccl.cmake:62 (message):
  Objcopy version is too old to support NCCL library slimming

‘Update objcopy’ didn’t give me anything on Google. I’m on a newly set-up Ubuntu 20.04 machine.




CMake Warning (dev) at third_party/gloo/CMakeLists.txt:21 (option):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

Not sure whether this is important.

(Edit: I got this one resolved.)

-- Could NOT find NCCL (missing: NCCL_INCLUDE_DIR NCCL_LIBRARY)

This one is super weird. I explicitly set these and echo $NCCL_INCLUDE_DIR gives /home/user/miniconda3/pkgs/nccl-1.3.5-cuda10.0_0/include/, and similarly for the library-path.




CMake Warning at cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake:1915 (add_executable):
  Cannot generate a safe runtime search path for target
  generate_proposals_op_gpu_test because files in some directories may
  conflict with libraries in implicit directories:

    runtime library [libnvToolsExt.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/cuda-11.2/lib64

  Some of these libraries may not be found correctly.

I got multiple warnings of the above form, all complaining specifically about
    runtime library [libnvToolsExt.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /usr/local/cuda-11.2/lib64

I read stackoverflow threads which dealt with the error message. But those didn’t seem actionable for this case, or maybe I just didn’t understand what I’m supposed to do exactly to remedy this. Set some environment variable maybe?
I would be really grateful for help in resolving these.