Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encountered permission denied error when compile pytorch on linux. #33130

Closed
zhonhel opened this issue Feb 9, 2020 · 5 comments
Closed

Encountered permission denied error when compile pytorch on linux. #33130

zhonhel opened this issue Feb 9, 2020 · 5 comments
Assignees
Labels
module: build Build system issues triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@zhonhel
Copy link

zhonhel commented Feb 9, 2020

I follow the descriptions on here: https://github.com/pytorch/pytorch#from-source to compile the pytorch on linux.
I compiled in a conda env.
But I encountered a permission denied error. The log is:

[70/3523] Performing build step for 'nccl_external'
FAILED: nccl_external-prefix/src/nccl_external-stamp/nccl_external-build nccl/lib/libnccl_static.a
cd /home/wangshihao/PycharmProjects/hrnet/pytorch/third_party/nccl/nccl && env CCACHE_DISABLE=1 SCCACHE_DISABLE=1 make CXX=/usr/local/bin/c++ CUDA_HOME=/usr/local/cuda NVCC=/usr/local/cuda/bin/nvcc NVCC_GENCODE=-gencode=arch=compute_75,code=sm_75 BUILDDIR=/home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl VERBOSE=0 -j && /home/wangshihao/miniconda3/envs/hrnet/bin/cmake -E touch /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl_external-prefix/src/nccl_external-stamp/nccl_external-build
make -C src build BUILDDIR=/home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl
make[1]: Entering directory `/home/wangshihao/PycharmProjects/hrnet/pytorch/third_party/nccl/nccl/src'
Grabbing   include/nccl_net.h                  > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/include/nccl_net.h
Generating nccl.h.in                           > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/include/nccl.h
Compiling  init.cc                             > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/init.o
Compiling  channel.cc                          > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/channel.o
Compiling  bootstrap.cc                        > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/bootstrap.o
Compiling  transport.cc                        > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/transport.o
Compiling  enqueue.cc                          > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/enqueue.o
Compiling  misc/group.cc                       > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/misc/group.o
Compiling  misc/nvmlwrap.cc                    > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/misc/nvmlwrap.o
Compiling  misc/ibvwrap.cc                     > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/misc/ibvwrap.o
Compiling  misc/rings.cc                       > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/misc/rings.o
Compiling  misc/utils.cc                       > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/misc/utils.o
Compiling  misc/argcheck.cc                    > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/misc/argcheck.o
Compiling  misc/trees.cc                       > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/misc/trees.o
Compiling  misc/topo.cc                        > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/misc/topo.o
Compiling  transport/p2p.cc                    > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/transport/p2p.o
Compiling  transport/shm.cc                    > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/transport/shm.o
Compiling  transport/net.cc                    > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/transport/net.o
Compiling  transport/net_socket.cc             > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/transport/net_socket.o
Compiling  transport/net_ib.cc                 > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/transport/net_ib.o
Compiling  collectives/all_reduce.cc           > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/collectives/all_reduce.o
Compiling  collectives/all_gather.cc           > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/collectives/all_gather.o
Compiling  collectives/broadcast.cc            > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/collectives/broadcast.o
Compiling  collectives/reduce.cc               > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/collectives/reduce.o
Compiling  collectives/reduce_scatter.cc       > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/collectives/reduce_scatter.o
Generating nccl.pc.in                          > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/lib/pkgconfig/nccl.pc
make[2]: Entering directory `/home/wangshihao/PycharmProjects/hrnet/pytorch/third_party/nccl/nccl/src/collectives/device'
Generating rules                               > /home/wangshihao/PycharmProjects/hrnet/pytorch/build/nccl/obj/collectives/device/Makefile.rules
/bin/sh: ./gen_rules.sh: Permission denied

Can anyone help me? Thank you very much~

@ptrblck
Copy link
Collaborator

ptrblck commented Feb 10, 2020

Could you check the file permissions in pytorch/third_party/nccl/nccl/src/collectives/device/?
It seems gen_rules.sh is not executable using your current user.

@cpuhrsch cpuhrsch self-assigned this Feb 11, 2020
@cpuhrsch cpuhrsch added module: build Build system issues triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Feb 11, 2020
@zhonhel
Copy link
Author

zhonhel commented Feb 12, 2020

Could you check the file permissions in pytorch/third_party/nccl/nccl/src/collectives/device/?
It seems gen_rules.sh is not executable using your current user.

Thanks a lot!
It is this problem.
That is because my source code is copied from Windows.
I execute:

chmod 777 -R {pytorch_source_dir}

solved this problem.

@zhonhel
Copy link
Author

zhonhel commented Feb 12, 2020

And I encountered another problem soon afterward:

/bin/sh: ./gen_rules.sh: /bin/bash^M: bad interpreter: No such file or directory

I searched on the Internet, and find this problem is also due to copying source code from Windows. And the solution in this blog solved this problem. https://blog.csdn.net/heatdeath/article/details/79463011

@ptrblck
Copy link
Collaborator

ptrblck commented Feb 12, 2020

That's good to hear!
Feel free to close this issue, if it was solved. ;)

@zhonhel zhonhel closed this as completed Feb 14, 2020
@jbhntr861
Copy link

Doesnt fix my problem looks like a broken link I still get sh: denied while trying to install modules vmmon and vmnet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: build Build system issues triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

4 participants