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

4GB of dependency packages for xpra-codecs-nvidia #3968

Closed
Rush-iam opened this issue Aug 21, 2023 · 6 comments
Closed

4GB of dependency packages for xpra-codecs-nvidia #3968

Rush-iam opened this issue Aug 21, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@Rush-iam
Copy link

I am trying to make installation as slim as possible for the Docker image and install only the APT packages I need, with the --no-install-recommends flag.

I found that installing xpra-codecs-nvidia requires an enormous 4GB of packages.
I remember that in Xpra 4.4.3, there were fewer packages - e.g. we didn't need libnvidia-compute-* packages to make things work.
I also want to use python3-pycuda from my Python environment and not an APT package, as it has a lot of dependencies. But it is not possible - I didn't find a way to skip redundant APT packages from installing.

Could you revisit and check the actual dependencies? Thank you!

# apt install --no-install-recommends xpra-codecs-nvidia                                                  
Reading package lists... Done                                                   
Building dependency tree... Done                                                
Reading state information... Done                                               
The following packages were automatically installed and are no longer required: 
  python3-gi-cairo python3-opengl                                               
Use 'apt autoremove' to remove them.                                            
The following additional packages will be installed:                            
  libaccinj64-11.5 libcub-dev libcublas11 libcublaslt11 libcudart11.0           
  libcufft10 libcufftw10 libcuinj64-11.5 libcupti-dev libcupti11.5 libcurand10  
  libcusolver11 libcusolvermg11 libcusparse11 libnppc11 libnppial11             
  libnppicc11 libnppidei11 libnppif11 libnppig11 libnppim11 libnppist11         
  libnppisu11 libnppitc11 libnpps11 libnvblas11 libnvidia-compute-495
  libnvidia-compute-510 libnvidia-compute-525 libnvidia-ml-dev libnvjpeg11      
  libnvrtc-builtins11.5 libnvrtc11.2 libnvtoolsext1 libnvvm4 libthrust-dev      
  nvidia-cuda-dev nvidia-cuda-toolkit nvidia-opencl-dev nvidia-profiler
  ocl-icd-opencl-dev opencl-c-headers opencl-clhpp-headers python3-appdirs
  python3-decorator python3-mako python3-markupsafe python3-pycuda
  python3-pytools
Suggested packages:
  opencl-clhpp-headers-doc python3-beaker python-mako-doc python3-matplotlib
  python3-pytest
Recommended packages:
  libcupti-doc libtbb-dev libvdpau-dev libnvcuvid1 nvidia-cuda-toolkit-doc
  nvidia-cuda-gdb nvidia-visual-profiler nsight-compute nsight-systems
  python-pycuda-doc libnvidia-encode1 libnvjpeg libnvidia-fbc1
The following NEW packages will be installed:
  libaccinj64-11.5 libcub-dev libcublas11 libcublaslt11 libcudart11.0
  libcufft10 libcufftw10 libcuinj64-11.5 libcupti-dev libcupti11.5 libcurand10
  libcusolver11 libcusolvermg11 libcusparse11 libnppc11 libnppial11
  libnppicc11 libnppidei11 libnppif11 libnppig11 libnppim11 libnppist11
  libnppisu11 libnppitc11 libnpps11 libnvblas11 libnvidia-compute-495
  libnvidia-compute-510 libnvidia-compute-525 libnvidia-ml-dev libnvjpeg11
  libnvrtc-builtins11.5 libnvrtc11.2 libnvtoolsext1 libnvvm4 libthrust-dev
  nvidia-cuda-dev nvidia-cuda-toolkit nvidia-opencl-dev nvidia-profiler
  ocl-icd-opencl-dev opencl-c-headers opencl-clhpp-headers python3-appdirs
  python3-decorator python3-mako python3-markupsafe python3-pycuda
  python3-pytools xpra-codecs-nvidia
0 upgraded, 50 newly installed, 0 to remove and 177 not upgraded.
Need to get 1,396 MB of archives.
After this operation, 3,999 MB of additional disk space will be used.
Do you want to continue? [Y/n]
@Rush-iam Rush-iam added the enhancement New feature or request label Aug 21, 2023
totaam added a commit that referenced this issue Aug 22, 2023
@totaam
Copy link
Collaborator

totaam commented Aug 22, 2023

In v4.4.x, the dependencies were "recommended" since there was no separate package for the nvidia codecs:

$ grep -i cuda packaging/debian/xpra/control 
#nvenc support requires pycuda (and its huge list of dependencies!)
        ,python3-pycuda, libnvidia-encode1

In v5.x, it made sense to change this to a hard dependency for xpra-codecs-nvidia since none of the nvidia codecs will work without cuda.
But the list you posted above does look really excessive, so I've moved it back to a "recommends" dependency.
You should then be able to not install the humongous Debian dependencies and manage it yourself.

FWIW: with RPM builds, we provide a fake-cuda package for this purpose. It allows users to pretend to have a cuda package installed, but to manage installations outside the package manager.

@allo-
Copy link

allo- commented Aug 23, 2023

Wouldn't suggests instead of recommends be more suitable? I think many systems install recommends by default and it does not only pull in a large list of packages, but also dev-packages and dkms packages which will build things during installation. I think having a -nvidia package is a useful way to split off the huge dependencies, but it shouldn't be installed by default on most systems and Debian/Ubuntu seem to install recommended packages by default.

https://www.debian.org/doc/manuals/debian-faq/pkg-basics.en.html#depends tells

Package A recommends Package B, if the package maintainer judges that most users would not want A without also having the functionality provided by B.
Package A suggests Package B if B contains files that are related to (and usually enhance) the functionality of A.

In my case, the server would not benefit from the nvidia package and the client benefits from it. By default, the package would be installed on both with the current dependency in the recommends section.

@totaam
Copy link
Collaborator

totaam commented Aug 23, 2023

Done.

@Rush-iam
Copy link
Author

I see the dependency list for v5.0 is still the same. Do changes apply starting from the next release?

@totaam
Copy link
Collaborator

totaam commented Aug 25, 2023

@Rush-iam this will be included in v5.0.1, I don't normally make stable builds without also making a new release.
Though I could make an exception here.

@Rush-iam
Copy link
Author

Rush-iam commented Sep 1, 2023

I tried v5.0.1:

# apt install --no-install-recommends xpra-common xpra-server xpra-x11 xpra-codecs xpra-codecs-nvidia
...
Need to get 10.6 MB of archives.
After this operation, 27.1 MB of additional disk space will be used.

Now, only 27mbytes to make everything I need work!
NVJPEG is working, and installation doesn't break my NVidia drivers as every version between 4.4.3 and 5.0.1 installs libnvidia-495/510/525 packages that break my Nvidia 470 driver.
Thank you!

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

No branches or pull requests

3 participants