Comments (13)
As I am trying to figure this out, can someone explain me the effect of the last chroot
call? (https://github.com/NVIDIA/libnvidia-container/blob/master/src/nvc_ldcache.c#L125). It seems to me that at this point, we are at the root of the target rootfs, which is already our /
thanks to the pivot_root(".", ".")
, so it looks like a no-op to me, but I'm probably missing some detail.
I found the equivalent code to change_rootfs
in runc
(https://github.com/opencontainers/runc/blob/63e6708c74c1cc46091ec92ea9df5aca4d82e803/libcontainer/rootfs_linux.go#L647) and it does not include the last chroot
call, so I'm confused.
from libnvidia-container.
This seems like a reasonable ask, @3XX0 what do you think? (he's out this week though)
Not sure if we should add a CLI flag like runc
, or if we should try to detect this situation like LXC.
from libnvidia-container.
As far as it goes, I have something working based on checking for the environment variable, I don't know if that's a satisfying implementation (once again, I'm quite new to this).
Pull request coming tomorrow morning (UTC+1) so you can see what you think about it.
from libnvidia-container.
We definitely don't want to rely on this environment variable :), libnvidia-container works outside of docker.
Again, we could either do like LXC:
https://github.com/lxc/lxc/blob/b988d228d1868e9bee6e7e4ded1eee859c4716fe/src/lxc/conf.c#L1580-L1591
https://github.com/lxc/lxc/blob/b988d228d1868e9bee6e7e4ded1eee859c4716fe/src/lxc/utils.c#L1297-L1342
Or like runc with runc run --no-pivot
.
I would defer to @3XX0 for the decision.
from libnvidia-container.
Oh yes that's something I should have thought about.
I'll send my PR with an if (no_pivot_root())
clearly separated from the rest so that you can plug in what you feel is right (or just do it from scratch if my code is broken).
EDIT: actually that will happen later, because as I understand my company would need to sign and send the CLA, and that will take a bit of time with many people being on holiday.
from libnvidia-container.
Closing as there doesn't seem to be anything to do.
from libnvidia-container.
Sorry but why is there nothing to do? The code still calls SYS_pivot_root
unconditionally, which will still fail with an initramfs.
from libnvidia-container.
Reasonable enough, I don't think I read this issue properly before closing it, sorry.
We will look into this, though this isn't a very high priority
from libnvidia-container.
I understand perfectly that this is a corner case.
If you give me a hint on which strategy you'd like from the two described earlier, I may be able to write the code and make a proper PR.
from libnvidia-container.
Can this ticket now be closed with the introduction of the --no-pivot-root
flag in the 1.1.0
release?
from libnvidia-container.
Since there has been no response, I am closing this issue.
@Ricordel please reopen / create a new issue if the --no-pivot-root
option does not address the issue.
from libnvidia-container.
Sorry for the HUGE delay responding, this subject got out of my radar during a long time.
After finally coming back to it, I tested with 1.4.0
and the --no-pivot-root
flag works just fine, thank you for including it.
from libnvidia-container.
Just a note. A fix was merged in https://gitlab.com/nvidia/container-toolkit/libnvidia-container/-/merge_requests/175 that ensures that the LDCache is updated when the --no-pivot-root
option is specified.
from libnvidia-container.
Related Issues (20)
- Error linking when the library version on the host is lower than that in the image
- BUG: nvidia-docker2 requires docker-ce on centos8/rhel9 where there's podman but not docker-ce HOT 1
- Ubuntu20.04 Release File Missing HOT 3
- Debian 11 repo is broken HOT 18
- 如何修改drv->devs->path的路径 HOT 1
- Building binaries, not just packages? HOT 2
- seg fault when running bundle with libnvidia-container-tools installed in container HOT 7
- why does nvidia-container-cli load libnvidia-ml via dlopen rather than linking directly? HOT 4
- Fail to start on second run. libs being set to 0 size HOT 2
- libnvidia-container ubuntu22.04/amd64 HOT 4
- libnvidia_container fails to compile with mold HOT 3
- Issue in permissions checking in nvcgo/internal/cgroup/ebpf.go ? HOT 2
- nvidia-container-runtime segfault HOT 2
- sudo yum install -y nvidia-container-toolkit failed - No such device
- nvidia-container-cli: initialization error: load library failed: libnvidia-ml.so.1: cannot open shared object file: no such file or directory
- Warning of Key is stored in legacy trusted.gpg keyring HOT 2
- Unprivileged `nvidia-container-cli --user configure`
- ldconfig-free deployment
- Unable to use more than 5 GPU cards HOT 2
- Building libnvidia-container 1.14.5 builds 1.14.4 HOT 19
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libnvidia-container.