0

So I am pretty new to Linux. I played around with installing CUDA libraries for some ML experiments on my linux system. However since a couple of weeks I have not been able to get updates to my system duo to some broken cuda packages?

My problem basically goes as follows:

sudo apt update

Get:1 file:/var/cuda-repo-ubuntu2204-11-8-local InRelease [1.575 B] Get:2 file:/var/cuda-repo-ubuntu2204-12-2-local InRelease [1.572 B] Get:3 file:/var/cuda-repo-ubuntu2204-12-3-local InRelease [1.572 B]
Get:1 file:/var/cuda-repo-ubuntu2204-11-8-local InRelease [1.575 B]
Get:4 file:/var/cudnn-local-repo-ubuntu2204-8.9.6.50 InRelease [1.572 B]
Get:2 file:/var/cuda-repo-ubuntu2204-12-2-local InRelease [1.572 B]
Get:3 file:/var/cuda-repo-ubuntu2204-12-3-local InRelease [1.572 B]
Get:4 file:/var/cudnn-local-repo-ubuntu2204-8.9.6.50 InRelease [1.572 B]
Get:5 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:6 https://downloads.plex.tv/repo/deb public InRelease
Hit:7 https://download.docker.com/linux/ubuntu jammy InRelease
Hit:8 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease
Hit:9 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 InRelease
Hit:10 http://be.archive.ubuntu.com/ubuntu jammy InRelease
Get:11 http://be.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Hit:12 https://repo.jellyfin.org/ubuntu jammy InRelease
Hit:13 http://be.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:14 https://nvidia.github.io/libnvidia-container/stable/deb/amd64 InRelease Hit:15 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease Fetched 229 kB in 1s (205 kB/s)
Reading package lists... Done Building dependency tree... Done Reading state information... Done 117 packages can be upgraded. Run 'apt list --upgradable' to see them.

The I run:

 sudo apt install

Reading package lists... Done Building dependency tree... Done Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: cuda-command-line-tools-12-3 : Depends: cuda-cupti-dev-12-3 (>= 12.3.101) but 12.3.52-1 is installed Depends: cuda-nvprof-12-3 (>= 12.3.101) but 12.3.52-1 is installed Depends: cuda-nvtx-12-3 (>= 12.3.101) but 12.3.52-1 is installed cuda-compiler-12-3 : Depends: cuda-cuxxfilt-12-3 (>= 12.3.101) but 12.3.52-1 is installed Depends: cuda-nvcc-12-3 (>= 12.3.103) but 12.3.52-1 is installed cuda-libraries-12-3 : Depends: cuda-cudart-12-3 (>= 12.3.101) but 12.3.52-1 is installed Depends: cuda-nvrtc-12-3 (>= 12.3.103) but 12.3.52-1 is installed Depends: cuda-opencl-12-3 (>= 12.3.101) but 12.3.52-1 is installed Depends: libcublas-12-3 (>= 12.3.4.1) but 12.3.2.9-1 is installed Depends: libcufft-12-3 (>= 11.0.12.1) but 11.0.11.19-1 is installed Depends: libcurand-12-3 (>= 10.3.4.101) but 10.3.4.52-1 is installed Depends: libcusolver-12-3 (>= 11.5.4.101) but 11.5.3.52-1 is installed Depends: libcusparse-12-3 (>= 12.2.0.103) but 12.1.3.153-1 is installed Depends: libnpp-12-3 (>= 12.2.3.2) but 12.2.2.32-1 is installed Depends: libnvjitlink-12-3 (>= 12.3.101) but 12.3.52-1 is installed Depends: libnvjpeg-12-3 (>= 12.3.0.81) but 12.2.3.32-1 is installed cuda-libraries-dev-12-3 : Depends: cuda-cudart-dev-12-3 (>= 12.3.101) but 12.3.52-1 is installed Depends: cuda-cccl-12-3 (>= 12.3.101) but 12.3.52-1 is installed Depends: cuda-profiler-api-12-3 (>= 12.3.101) but 12.3.52-1 is installed Depends: cuda-driver-dev-12-3 (>= 12.3.101) but 12.3.52-1 is installed Depends: cuda-nvrtc-dev-12-3 (>= 12.3.103) but 12.3.52-1 is installed Depends: cuda-opencl-dev-12-3 (>= 12.3.101) but 12.3.52-1 is installed Depends: libcublas-dev-12-3 (>= 12.3.4.1) but 12.3.2.9-1 is installed Depends: libcufft-dev-12-3 (>= 11.0.12.1) but 11.0.11.19-1 is installed Depends: libcurand-dev-12-3 (>= 10.3.4.101) but 10.3.4.52-1 is installed Depends: libcusolver-dev-12-3 (>= 11.5.4.101) but 11.5.3.52-1 is installed Depends: libcusparse-dev-12-3 (>= 12.2.0.103) but 12.1.3.153-1 is installed Depends: libnpp-dev-12-3 (>= 12.2.3.2) but 12.2.2.32-1 is installed Depends: libnvjitlink-dev-12-3 (>= 12.3.101) but 12.3.52-1 is installed Depends: libnvjpeg-dev-12-3 (>= 12.3.0.81) but 12.2.3.32-1 is installed cuda-nvcc-12-3 : Depends: cuda-nvvm-12-3 (= 12.3.52-1) but 12.3.103-1 is installed Depends: cuda-crt-12-3 (= 12.3.52-1) but 12.3.103-1 is installed cuda-toolkit-12-3 : Depends: cuda-nvml-dev-12-3 (>= 12.3.101) but 12.3.52-1 is installed cuda-visual-tools-12-3 : Depends: cuda-nvml-dev-12-3 (>= 12.3.101) but 12.3.52-1 is installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Then when I try

sudo apt --fix-broken install 

I get the following:

...*long code paragraphs*
    101-1_amd64.deb ...
Unpacking cuda-nvml-dev-12-3 (12.3.101-1) over (12.3.52-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-VjvbGI/31-cuda-nvml-dev-12-3_12.3.101-1_amd64.deb (--unpack)
:
 trying to overwrite '/usr/local/cuda-12.3/include', which is also in package cuda-cccl-12-3 12.3.52-1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 /tmp/apt-dpkg-install-VjvbGI/00-cuda-cupti-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/01-cuda-cupti-dev-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/02-cuda-nvprof-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/03-cuda-nvtx-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/04-cuda-cuxxfilt-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/05-cuda-cudart-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/06-cuda-cccl-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/07-cuda-driver-dev-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/08-cuda-cudart-dev-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/09-cuda-nvcc-12-3_12.3.103-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/10-cuda-nvrtc-12-3_12.3.103-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/11-cuda-opencl-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/12-libcublas-12-3_12.3.4.1-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/13-libcufft-12-3_11.0.12.1-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/14-libcurand-12-3_10.3.4.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/15-libcusolver-12-3_11.5.4.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/16-libcusparse-12-3_12.2.0.103-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/17-libnpp-12-3_12.2.3.2-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/18-libnvjitlink-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/19-libnvjpeg-12-3_12.3.0.81-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/20-cuda-profiler-api-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/21-cuda-nvrtc-dev-12-3_12.3.103-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/22-cuda-opencl-dev-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/23-libcublas-dev-12-3_12.3.4.1-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/24-libcufft-dev-12-3_11.0.12.1-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/25-libcurand-dev-12-3_10.3.4.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/26-libcusolver-dev-12-3_11.5.4.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/27-libcusparse-dev-12-3_12.2.0.103-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/28-libnpp-dev-12-3_12.2.3.2-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/29-libnvjitlink-dev-12-3_12.3.101-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/30-libnvjpeg-dev-12-3_12.3.0.81-1_amd64.deb
 /tmp/apt-dpkg-install-VjvbGI/31-cuda-nvml-dev-12-3_12.3.101-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Can somebody please tell me how to fix this?

Slinky
  • 1
  • 1
    Remove those file:... and all third party PPA repositories then run sudo apt update and try again. – Raffa Dec 17 '23 at 13:08
  • See https://askubuntu.com/questions/1077061/how-do-i-install-nvidia-and-cuda-drivers-into-ubuntu/1077063#1077063 https://askubuntu.com/questions/1219761/cuda-10-2-different-installation-paths/1244010#1244010 Basically avoid tangling CUDA up with your system files or package manager, and use its private location for bin and lib. – ubfan1 Dec 17 '23 at 16:17

1 Answers1

0

Welcome to wonderful world of CUDA and NVIDIA :-)

Basically, you (most likely) are trying to update your CUDA installation and it's updates are incompatible with your installed NVIDIA drivers. This is most often caused by installing NVIDA drivers from your distribution and then installing CUDA via the NVIDIA developers CUDA Toolkit [https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html].

The solution(s) are either (a) wait for your distribution to update their driver packages so that the version numbers satisfy the CUDA update requirements OR (b) remove/purge the installed NVIDIA drivers and then install both NVIDIA drivers AND the CUDA from NVIDIA. The disadvantage of this second method is that there is often some special tweaks that the DISTRO maintainers do to the NVIDIA packages to mitigate any issues with their specific distribution.

Andor Kiss
  • 779
  • 1
  • 6
  • 19
  • 2
    There is room for improvement in your answer like addressing the local file:... repositories as those are most likely old and probably don't reflect their online equivalents and the other third party PPA repositories ... Those need to be disabled/updated before any other APT action can be attempted or the result might be the same or even worse ... I think – Raffa Dec 17 '23 at 13:18
  • Yeah, right - probably should uninstall/purge everything and start again - less likely to have any conflicts. – Andor Kiss Dec 17 '23 at 13:26
  • Problem is that I can't seem to uninstall either nvidia-cuda-toolkit or nvidia in general since I keep getting the same broken dependencies error... – Slinky Dec 18 '23 at 18:58
  • I'd uninstall everything NVIDIA and CUDA and start from scratch. – Andor Kiss Jan 13 '24 at 13:47