无法在 Ubuntu 18.04 LXC 容器中安装 mesa 和升级 OpenGL

无法在 Ubuntu 18.04 LXC 容器中安装 mesa 和升级 OpenGL

问题:
我正在尝试将我的 OpenGL 升级到 3.3+。根据 Webots 的输出,似乎我的服务器(Ubuntu 18.04 的容器)配备了 OpenGL 3.1:

root@zc:~# webots
Fontconfig error: Cannot load default config file
FATAL: Webots requires OpenGL 3.3 while only OpenGL 3.1 can be initialized.

我无法使用glxinfo命令:

root@zc:~# glxinfo | grep "OpenGL version"
-bash: glxinfo: command not found

当我尝试安装 mesa-utils 时,遇到了未满足的依赖项:

root@zc:~# sudo apt-get install mesa-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 cuda-drivers : Depends: nvidia-compute-utils-440 (>= 440.33.01) but it is not going to be installed
                Depends: nvidia-utils-440 (>= 440.33.01) but it is not going to be installed
 nvidia-driver-440 : Depends: nvidia-compute-utils-440 (= 440.33.01-0ubuntu1) but it is not going to be installed
                     Depends: nvidia-utils-440 (= 440.33.01-0ubuntu1) but it is not going to be installed
                     Recommends: libnvidia-compute-440:i386 (= 440.33.01-0ubuntu1) but it is not installable
                     Recommends: libnvidia-decode-440:i386 (= 440.33.01-0ubuntu1) but it is not installable
                     Recommends: libnvidia-encode-440:i386 (= 440.33.01-0ubuntu1) but it is not installable
                     Recommends: libnvidia-ifr1-440:i386 (= 440.33.01-0ubuntu1) but it is not installable
                     Recommends: libnvidia-fbc1-440:i386 (= 440.33.01-0ubuntu1) but it is not installable
                     Recommends: libnvidia-gl-440:i386 (= 440.33.01-0ubuntu1) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

我的GPU(nvidia-smi输出,2*1080 Ti):

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.73.01    Driver Version: 460.73.01    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+

nvcc -V的输出(我的pytorch基于cuda 10.2,可以运行):

root@zc:~# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:24:38_PDT_2019
Cuda compilation tools, release 10.2, V10.2.89

我尝试过的:

    root@zc:~# 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:
      nvidia-compute-utils-440 nvidia-utils-440
    The following NEW packages will be installed:
      nvidia-compute-utils-440 nvidia-utils-440
    0 upgraded, 2 newly installed, 0 to remove and 28 not upgraded.
    385 not fully installed or removed.
    Need to get 0 B/418 kB of archives.
    After this operation, 1,298 kB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Get:1 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  nvidia-compute-utils-440 440.33.01-0ubuntu1 [73.8 kB]
    Get:2 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  nvidia-utils-440 440.33.01-0ubuntu1 [345 kB]
    dpkg: warning: files list file for package 'libquadmath0:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libnpth0:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'fdisk' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'iputils-ping' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'ubuntu-advantage-tools' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libedit2:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'python3-cryptography' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libpam-runtime' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'vim-tiny' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libncurses5:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libcom-err2:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libgomp1:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libatomic1:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libpython3-stdlib:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'cpp' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'python-pip-whl' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libapt-pkg5.0:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libaudit1:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'readline-common' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'python3-yaml' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libpython3.6-stdlib:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'ncurses-term' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'console-setup' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libtinfo5:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libapt-inst2.0:amd64' missing; assuming package has no files currently installed
(And a lot of dpkg warning message here)
    dpkg: warning: files list file for package 'sed' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libpython3.6:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libsmartcols1:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'netbase' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libpython3-dev:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'libisl19:amd64' missing; assuming package has no files currently installed
    dpkg: warning: files list file for package 'binutils-x86-64-linux-gnu' missing; assuming package has no files currently installed
    (Reading database ... 18232 files and directories currently installed.)
    Preparing to unpack .../nvidia-compute-utils-440_440.33.01-0ubuntu1_amd64.deb ...
    Unpacking nvidia-compute-utils-440 (440.33.01-0ubuntu1) ...
    dpkg: error processing archive /var/cuda-repo-10-2-local-10.2.89-440.33.01/./nvidia-compute-utils-440_440.33.01-0ubuntu1_amd64.deb (--unpack):
     unable to make backup link of './usr/bin/nvidia-cuda-mps-control' before installing new version: Invalid cross-device link
    Preparing to unpack .../nvidia-utils-440_440.33.01-0ubuntu1_amd64.deb ...
    Unpacking nvidia-utils-440 (440.33.01-0ubuntu1) ...
    dpkg: error processing archive /var/cuda-repo-10-2-local-10.2.89-440.33.01/./nvidia-utils-440_440.33.01-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)
    Errors were encountered while processing:
     /var/cuda-repo-10-2-local-10.2.89-440.33.01/./nvidia-compute-utils-440_440.33.01-0ubuntu1_amd64.deb
     /var/cuda-repo-10-2-local-10.2.89-440.33.01/./nvidia-utils-440_440.33.01-0ubuntu1_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

那么问题的根源是什么?我该如何解决它?为什么尽管我有 460 驱动程序,但仍存在未满足的依赖关系?

相关内容