-
Notifications
You must be signed in to change notification settings - Fork 181
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
Nvidia devel tools get removed from rocker/cuda-based images #736
Comments
@cboettig Any thoughts? |
Interesting. This does not happen with b-data's/my CUDA-enabled JupyterLab docker stacks which are also based on I use apt-get -y purge PACKAGES
apt-get -y autoremove
rm -rf /var/lib/apt/lists/* instead of apt-get remove --purge -y PACKAGES
apt-get autoremove -y
apt-get autoclean -y
rm -rf /var/lib/apt/lists/* 👉 Yes... somehow Another difference: b-data's/my images copy R from image |
@cboettig Could you take a look at this? |
@eitsupi thanks for the ping, yeah I'll take a look! |
Yup,
it looks like some of the build deps are (unsurprisingly) also build deps of cuda-devel. Still seems a bit puzzling to me that it would grab some of the nvidia tools. Removing build-deps this way in rocker/r-ver recipe is relatively dated strategy -- I believe multi-staged builds are the standard way to build images without including development dependencies. (Though that mechanism didn't exist when this build recipe was initially deployed in rocker!) @eitsupi I'm not quite sure how best to go about setting up a staged build dockerfile in the current build system though -- thoughts on how to go about that? Perhaps a simpler / short-term solution would be to add a build arg to suppress the build_deps removal and set that argument in the ml stack.... (given the size of the cuda libs the R build deps are mostly already included or won't add much more to the image size I think). |
I don't think there's a problem with doing a multi-stage build because we just change the description in the Dockerfile. I don't know how R on CUDA is built, but is it enough to copy R from |
@eitsupi nice, I think that's a good idea -- let's leave Hmm, we can copy R_HOME from |
Okay, I'm thinking something like this as the replacement rocker/cuda Dockerfile template:
This introduces I noticed that setup_R.sh also removes some build deps that are compression libraries, maybe we should simply not do that there? |
@cboettig Did you see the comment #736 (comment)? |
@eitsupi I think you mean the reverse, that we should use I always thought that @benz0li any chance you meant that you use |
When I read over the come For |
No. See https://github.com/b-data/jupyterlab-r-docker-stack/blob/e41ce09e241a060e5d4f9e558121b925007f52cc/base/latest.Dockerfile#L299-L301 for example.
@cboettig According to the manual page: remove --purge is equivalent to the purge command. In my images linux packages do not get removed, because R is built in a separate image and then copied [from |
Thanks for looking into this everyone! I did some testing regarding the I took
(cf. l. 35)
(cf. l. 61)
In different containers, I then ran This lead to identical results with the following list of packages to be removed/marked for removal (note that this does, amongst others, include
According to https://www.mankier.com/8/apt-get#--purge, Additionally, Judging from this I would say this is not about subtle differences in command syntax (they seem to be identical/working as expected/documented), but a rather curious case of Debian/Ubuntu dependency management, where a collection of packages to be installed will pull in additional dependencies and/or create "reverse dependencies" which, once uninstalling the original set of packages, do proceed to rip out other parts of the system... |
Thanks all, details super appreciated. Working on fix for this in recent PRs. A multi-stage build is probably the natural thing but a non-trivial shift, for the moment I think we'll simply leave the builddeps in place on the |
Container image name
rocker/cuda
Container image digest
No response
What operating system related to this question?
Linux
System information
No response
Question
As they are based on nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 (dockerfiles/cuda_4.3.0.Dockerfile), I was expecting to have the full CUDA Toolkit devel environment available when using any of the rocker/cuda and derived images.
However, https://github.com/rocker-org/rocker-versioned2/blob/de8b815b1b23c368308cc9dc960cb8a7c724be9f/scripts/install_R_source.sh#L160C39 seems to remove relevant packages (although not explicitly specified). This includes
cuda-compiler-11-8*, cuda-minimal-build-11-8*, cuda-nvcc-11-8*
and marks others for subsequent autoremoval (cuda-cuxxfilt-11-8, cuda-nvprune-11-8
).This does e.g. prevent the torch package to be easily installed with GPU-support within such containers.
Is this done intentionally?
The text was updated successfully, but these errors were encountered: