从 ubuntu 16.04 一直升级到 ubuntu 18.04 后,我在 apt-get 升级期间看到很多这样的消息。
/sbin/ldconfig.real: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf.d/nvidia_settings.conf
update-initramfs: Generating /boot/initrd.img-4.15.0-29-generic
/sbin/ldconfig.real: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf.d/nvidia_settings.conf: No such file or directory
有时我的 nvidia 驱动程序可以加载,有时则不能。我目前使用的是 ppa:graphics-drivers/ppa。我尝试过多次清除 nvidia。不想重新安装。问题似乎是 nvidia_settings_conf 的符号链接无处可去,但我不确定它应该在哪里。
输出 nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.77 Driver Version: 390.77 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 770 Off | 00000000:01:00.0 N/A | N/A |
| 34% 39C P8 N/A / N/A | 102MiB / 1991MiB | N/A Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 Not Supported |
+-----------------------------------------------------------------------------+
‘ls -al /etc/ld.so.conf.d/’ 的输出
➜ ~ ls -al /etc/ld.so.conf.d/
total 40
drwxr-xr-x 2 root root 4096 mai 2 19:01 .
drwxr-xr-x 206 root root 16384 juli 21 17:11 ..
-rw-rw-r-- 1 root root 38 mars 24 2014 fakeroot-x86_64-linux-gnu.conf
-rw-r--r-- 1 root root 168 april 16 22:14 i386-linux-gnu.conf
-rw-r--r-- 1 root root 44 aug. 9 2009 libc.conf
-rw-r--r-- 1 root root 26 des. 26 2017 local.conf
lrwxrwxrwx 1 root root 38 mai 14 2014 nvidia_settings.conf -> /etc/alternatives/nvidia_settings_conf
-rw-r--r-- 1 root root 100 april 16 22:14 x86_64-linux-gnu.conf
➜ ~ ls -al /etc/alternatives/ | grep nvidia
lrwxrwxrwx 1 root root 41 mai 14 2014 libxnvctrl.a -> /usr/lib/nvidia-settings-319/libXNVCtrl.a
lrwxrwxrwx 1 root root 72 mai 14 2014 man_nvidiasettings.gz -> /usr/lib/nvidia-settings-319/share/man/man1/alt-nvidia-settings-319.1.gz
lrwxrwxrwx 1 root root 43 mai 14 2014 nvctrl_include -> /usr/lib/nvidia-settings-319/include/NVCtrl
lrwxrwxrwx 1 root root 48 mai 14 2014 nvidia_settings -> /usr/lib/nvidia-settings-319/bin/nvidia-settings
lrwxrwxrwx 1 root root 39 mai 14 2014 nvidia_settings_conf -> /usr/lib/nvidia-settings-319/ld.so.conf
ls -al /usr/lib/ | grep nvidia
-rw-r--r-- 1 root root 1467112 mai 2 23:00 libnvidia-gtk2.so.396.24
-rw-r--r-- 1 root root 1475784 mai 2 23:00 libnvidia-gtk3.so.396.24
drwxr-xr-x 2 root root 4096 mai 2 18:09 nvidia
drwxr-xr-x 2 root root 4096 aug. 4 2014 nvidia-319
drwxr-xr-x 2 root root 4096 nov. 19 2015 nvidia-346
drwxr-xr-x 2 root root 4096 mai 2 18:55 nvidia-390
答案1
我从 16.04 升级到 18.04 后也出现了类似的警告
我已将nvidia-settings.conf
其删除/etc/ld.so.conf.d
,因为它指向的文件不存在。到目前为止一切顺利...
答案2
server:/etc/ld.so.conf.d$ sudo mv nvidia_settings.conf OLD_nvidia_settings.conf_OLD
此文件与 /etc/alternatives/nvidia_settings.conf 的链接已损坏,请重命名为老的_nvidia_settings.conf_老的在 /etc/ld.so.conf.d 中,因为您不知道是否正在寻找以 nvidia_settings 开头的文件....
答案3
这个问题很明显。错误显示:
/sbin/ldconfig.real: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf.d/nvidia_settings.conf
但实际的链接是/etc/ld.so.conf.d/nvidia_settings_conf
错误:nvidia_settings.conf
正确: nvidia_settings_conf
重命名链接并且它有效。