docker apt 安装 cuda

root@yeqiang-PC:/opt/speccpu2006# docker exec -it 881 /bin/bash
root@8815d0425401:/# apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libnvidia-cfg1-535 libnvidia-compute-535 libnvidia-extra-535 nvidia-compute-utils-535 nvidia-utils-535
The following NEW packages will be installed:
  libnvidia-cfg1-535 libnvidia-compute-535 libnvidia-extra-535 nvidia-compute-utils-535 nvidia-utils-535
0 upgraded, 5 newly installed, 0 to remove and 103 not upgraded.
180 not fully installed or removed.
Need to get 37.7 MB of archives.
After this operation, 178 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64  libnvidia-compute-535 535.54.03-0ubuntu1 [36.7 MB]
Get:2 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64  nvidia-compute-utils-535 535.54.03-0ubuntu1 [285 kB]    
Get:3 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64  libnvidia-extra-535 535.54.03-0ubuntu1 [255 kB]         
Get:4 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64  nvidia-utils-535 535.54.03-0ubuntu1 [377 kB]            
Get:5 https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64  libnvidia-cfg1-535 535.54.03-0ubuntu1 [98.9 kB]         
Fetched 37.7 MB in 10s (3861 kB/s)                                                                                                       
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 79513 files and directories currently installed.)
Preparing to unpack .../libnvidia-compute-535_535.54.03-0ubuntu1_amd64.deb ...
Unpacking libnvidia-compute-535:amd64 (535.54.03-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libnvidia-compute-535_535.54.03-0ubuntu1_amd64.deb (--unpack):
 unable to make backup link of './usr/lib/x86_64-linux-gnu/libcuda.so.535.54.03' before installing new version: Invalid cross-device link
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../nvidia-compute-utils-535_535.54.03-0ubuntu1_amd64.deb ...
Unpacking nvidia-compute-utils-535 (535.54.03-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/nvidia-compute-utils-535_535.54.03-0ubuntu1_amd64.deb (--unpack):
 unable to make backup link of './usr/bin/nvidia-cuda-mps-control' before installing new version: Invalid cross-device link
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../libnvidia-extra-535_535.54.03-0ubuntu1_amd64.deb ...
Unpacking libnvidia-extra-535:amd64 (535.54.03-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libnvidia-extra-535_535.54.03-0ubuntu1_amd64.deb (--unpack):
 unable to make backup link of './usr/lib/x86_64-linux-gnu/libnvidia-allocator.so.535.54.03' before installing new version: Invalid cross-device link
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../nvidia-utils-535_535.54.03-0ubuntu1_amd64.deb ...
Unpacking nvidia-utils-535 (535.54.03-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/nvidia-utils-535_535.54.03-0ubuntu1_amd64.deb (--unpack):
 unable to make backup link of './usr/bin/nvidia-debugdump' before installing new version: Invalid cross-device link
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../libnvidia-cfg1-535_535.54.03-0ubuntu1_amd64.deb ...
Unpacking libnvidia-cfg1-535:amd64 (535.54.03-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libnvidia-cfg1-535_535.54.03-0ubuntu1_amd64.deb (--unpack):
 unable to make backup link of './usr/lib/x86_64-linux-gnu/libnvidia-cfg.so.535.54.03' before installing new version: Invalid cross-device link
Errors were encountered while processing:
 /var/cache/apt/archives/libnvidia-compute-535_535.54.03-0ubuntu1_amd64.deb
 /var/cache/apt/archives/nvidia-compute-utils-535_535.54.03-0ubuntu1_amd64.deb
 /var/cache/apt/archives/libnvidia-extra-535_535.54.03-0ubuntu1_amd64.deb
 /var/cache/apt/archives/nvidia-utils-535_535.54.03-0ubuntu1_amd64.deb
 /var/cache/apt/archives/libnvidia-cfg1-535_535.54.03-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

20.04 22.04 ubuntu docker 均存在相似错误

22.04 virtualbox虚拟机测试,则正常安装cuda

 说明该故障与docker相关。

考虑docker内采用runfile方式安装cuda

参考

NVIDIA-Linux-x86_64-535.54.03.run cuda_12.2.0_535.54.03_linux.run下载地址_hkNaruto的博客-CSDN博客

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐