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

openmpi run as a non-root user #1

Open
caizexin opened this issue Jan 17, 2020 · 1 comment
Open

openmpi run as a non-root user #1

caizexin opened this issue Jan 17, 2020 · 1 comment

Comments

@caizexin
Copy link

When I tried to run python spinup/examples/bench_ppo_cartpole.py as said in homework 1, it failed as the openmpi command called by the python code raised an error saying that openmpi could not run as a root user. link to this issue

It works when I use an alternative command python -m spinup.run ppo --env CartPole-v0, otherwise I need to add a new user, switch the user and run the code.

@qiaoximing
Copy link

I find an easier solution for the OpenMPI's root user issue.
If you dig into Spinningup's source code, you'll notice that it calls mpirun in only one place, which is line 31, spinningup/spinup/utils/mpi_tools.py.
Changing args = ["mpirun", "-np", str(n)] to args = ["mpirun", "--allow-run-as-root", "-np", str(n)] solves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants