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

How to get the process pid in docker? #36

Open
xianjiez opened this issue May 20, 2021 · 1 comment
Open

How to get the process pid in docker? #36

xianjiez opened this issue May 20, 2021 · 1 comment

Comments

@xianjiez
Copy link

xianjiez commented May 20, 2021

I get the process pid in docker through nvmlDeviceGetComputeRunningProcesses(), which is the process pid on the host machine, but this is different from the process pid in docker. Is there a way to get the process pid in docker instead of the pid on the host machine?

@xianjiez xianjiez changed the title How to get the pid of the current program? How to get the pid on GPU of the current program? May 20, 2021
@xianjiez xianjiez reopened this May 20, 2021
@xianjiez xianjiez changed the title How to get the pid on GPU of the current program? How to get the process pid in docker? May 20, 2021
@fostiropoulos
Copy link

You would need to run docker with the option --pid host to be able to get the process id, as the host machine and container must share PID space. There are caveats when the host and docker machine OS differ.

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