Unable to install CUDA 12.0 toolkit

emmay@meenakshi-ubuntu:~$ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
--2023-02-24 14:03:28--  https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
Resolving developer.download.nvidia.com (developer.download.nvidia.com)... 152.195.19.142
Connecting to developer.download.nvidia.com (developer.download.nvidia.com)|152.195.19.142|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 190 [application/octet-stream]
Saving to: ‘cuda-ubuntu2204.pin’

cuda-ubuntu2204.pin 100%[===================>]     190  --.-KB/s    in 0s      

2023-02-24 14:03:28 (3.16 MB/s) - ‘cuda-ubuntu2204.pin’ saved [190/190]

emmay@meenakshi-ubuntu:~$ sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
emmay@meenakshi-ubuntu:~$ wget https://developer.download.nvidia.com/compute/cuda/12.0.1/local_installers/cuda-repo-ubuntu2204-12-0-local_12.0.1-525.85.12-1_amd64.deb
--2023-02-24 14:03:48--  https://developer.download.nvidia.com/compute/cuda/12.0.1/local_installers/cuda-repo-ubuntu2204-12-0-local_12.0.1-525.85.12-1_amd64.deb
Resolving developer.download.nvidia.com (developer.download.nvidia.com)... 152.195.19.142
Connecting to developer.download.nvidia.com (developer.download.nvidia.com)|152.195.19.142|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3101162268 (2.9G) [application/x-deb]
Saving to: ‘cuda-repo-ubuntu2204-12-0-local_12.0.1-525.85.12-1_amd64.deb’

cuda-repo-ubuntu220 100%[===================>]   2.89G  13.2MB/s    in 5m 16s  

2023-02-24 14:09:04 (9.37 MB/s) - ‘cuda-repo-ubuntu2204-12-0-local_12.0.1-525.85.12-1_amd64.deb’ saved [3101162268/3101162268]

emmay@meenakshi-ubuntu:~$ sudo dpkg -i cuda-repo-ubuntu2204-12-0-local_12.0.1-525.85.12-1_amd64.deb
(Reading database ... 210838 files and directories currently installed.)
Preparing to unpack cuda-repo-ubuntu2204-12-0-local_12.0.1-525.85.12-1_amd64.deb ...
Unpacking cuda-repo-ubuntu2204-12-0-local (12.0.1-525.85.12-1) ...
dpkg-deb (subprocess): decompressing archive 'cuda-repo-ubuntu2204-12-0-local_12.0.1-525.85.12-1_amd64.deb' (size=3101162268) member 'data.tar': lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive cuda-repo-ubuntu2204-12-0-local_12.0.1-525.85.12-1_amd64.deb (--install):
 cannot copy extracted data for './var/cuda-repo-ubuntu2204-12-0-local/libnvidia-gl-525_525.85.12-0ubuntu1_amd64.deb' to '/var/cuda-repo-ubuntu2204-12-0-local/libnvidia-gl-525_525.85.12-0ubuntu1_amd64.deb.dpkg-new': unexpected end of file or stream
Errors were encountered while processing:
 cuda-repo-ubuntu2204-12-0-local_12.0.1-525.85.12-1_amd64.deb
emmay@meenakshi-ubuntu:~$ 

I am getting this error while trying ti install nvidia-cuda-toolkit. I can see the nsight-compute folder but it somehow during installation, it is throwing this error. Any help from your end will be highly appreciated

Hi @marya1
When using the local repo installer it is important to verify the integrity by comparison the file checksum with the posted checksum: https://developer.download.nvidia.com/compute/cuda/12.0.1/docs/sidebar/md5sum.txt

For example:

$ wget https://developer.download.nvidia.com/compute/cuda/12.0.1/docs/sidebar/md5sum.txt
$ md5sum -c <(grep cuda-repo-*.deb md5sum.txt)
cuda-repo-ubuntu2204-12-0-local_12.0.1-525.85.12-1_amd64.deb: OK

Afterwards, apt-get install the package name cuda-toolkit-12-0 or you can install one of these other meta-package entry points.

Please note that nvidia-cuda-toolkit package is not from the NVIDIA repository. You can check this by the repo URL with

$ apt-cache madison nvidia-cuda-toolkit
nvidia-cuda-toolkit | 11.5.1-1ubuntu1 | http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages

versus

$ apt-cache madison cuda-toolkit-12-0
cuda-toolkit-12-0 |   12.0.1-1 | https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  Packages
cuda-toolkit-12-0 |   12.0.0-1 | https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  Packages