![如何将 prime-select intel 与新的 nvidia 驱动程序结合使用](https://linux22.com/image/1023234/%E5%A6%82%E4%BD%95%E5%B0%86%20prime-select%20intel%20%E4%B8%8E%E6%96%B0%E7%9A%84%20nvidia%20%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E7%BB%93%E5%90%88%E4%BD%BF%E7%94%A8.png)
自从安装了新的 nvidia 专有驱动程序 465.27 后,prime-select nvidia
我的外接显示器才可以工作。我的内置显示器可以使用,prime-select intel
但我收到“无法启动 NVIDIA Persistence Daemon”消息,并且外接显示器无法工作。输出来自journalctl -u nvidia-persistenced
:
-- Reboot --
Jun 04 23:46:56 qwr-ThinkPad-P51 systemd[1]: Starting NVIDIA Persistence Daemon...
Jun 04 23:46:57 qwr-ThinkPad-P51 nvidia-persistenced[1212]: Verbose syslog connection opened
Jun 04 23:46:57 qwr-ThinkPad-P51 nvidia-persistenced[1212]: Now running with user ID 122 and group ID 127
Jun 04 23:46:57 qwr-ThinkPad-P51 nvidia-persistenced[1212]: Started (1212)
Jun 04 23:46:57 qwr-ThinkPad-P51 nvidia-persistenced[1212]: Failed to query NVIDIA devices. Please ensure that the NVIDIA device files (/dev/nvidia*) exist, and that user 122 has read and write permissions for those files.
Jun 04 23:46:57 qwr-ThinkPad-P51 nvidia-persistenced[1212]: PID file unlocked.
Jun 04 23:46:57 qwr-ThinkPad-P51 nvidia-persistenced[1189]: nvidia-persistenced failed to initialize. Check syslog for more details.
Jun 04 23:46:57 qwr-ThinkPad-P51 nvidia-persistenced[1212]: PID file closed.
Jun 04 23:46:57 qwr-ThinkPad-P51 systemd[1]: nvidia-persistenced.service: Control process exited, code=exited, status=1/FAILURE
Jun 04 23:46:57 qwr-ThinkPad-P51 nvidia-persistenced[1212]: The daemon no longer has permission to remove its runtime data directory /var/run/nvidia-persistenced
Jun 04 23:46:57 qwr-ThinkPad-P51 nvidia-persistenced[1212]: Shutdown (1212)
Jun 04 23:46:57 qwr-ThinkPad-P51 systemd[1]: nvidia-persistenced.service: Failed with result 'exit-code'.
Jun 04 23:46:57 qwr-ThinkPad-P51 systemd[1]: Failed to start NVIDIA Persistence Daemon.
看起来像是权限问题?
答案1
nvidia-smi -pm 1
以 root身份尝试
礼貌https://docs.nvidia.com/deploy/driver-persistence/index.html
5.4. Usage
To run the NVIDIA Persistence Daemon, simply run (as root):
# nvidia-persistenced --user foo
After doing a minimal amount of setup tasks that require super-user privileges, the daemon will drop super-user privileges and run as user 'foo'.
You may use NVIDIA SMI to change the persistence mode setting. For example, to disable persistence mode on all GPUs, simply run (again, as root):
# nvidia-smi -pm 0
Please see the nvidia-persistenced(1) manpage, which is installed by the NVIDIA GPU driver installer, or the output of:
% nvidia-persistenced --help
for detailed usage information.
您可能还对驱动程序提供的补充初始化脚本感兴趣。上面的链接中也有记录:
5.5. Installation Caveats
The reason why we cannot immediately deprecate the legacy persistence mode and switch transparently to the NVIDIA Persistence Daemon is because at this time, we cannot guarantee that the NVIDIA Persistence Daemon will be running. This would be a feature regression as persistence mode might not be available out-of- the-box.
The NVIDIA Persistence Daemon ships with the NVIDIA Linux GPU driver starting in driver version 319 and is installed by the installer as /usr/bin/nvidia-persistenced. Ideally, the daemon would start on system initialization according to the Linux distribution's init system, transparently to the user, and exit on system shutdown. Unfortunately, there is no single standard for installing an application to start on system initialization on Linux, so we cannot reliably do so on the wide range of systems the NVIDIA GPU driver supports.
Therefore, we want to encourage individual distributions, who typically re-package the NVIDIA GPU driver for installation via their package manager, to install the NVIDIA Persistence Daemon to start on system initialization, which is a nearly trivial task once the init system is known. To this end, we are providing sample "init scripts" in the driver package to aid in this installation. These scripts attempt to cover three of the most prevalent init systems found in Linux distributions today: SystemV, systemd, and Upstart. The sample scripts also come with an installer script that attempts to detect the init system and install the appropriate script for the user. The sample scripts and installer script are installed to /usr/share/doc/NVIDIA_GLX-1.0/sample/nvidia-persistenced-init.tar.bz2 by the NVIDIA GPU driver installer. They are not unpacked or run by the driver installer since we cannot guarantee that they will work correctly on all supported systems out-of-the-box.
By default, the installer scripts attempt to create a new system user for the daemon to run as, and the sample init scripts demonstrate the second option described in Permissions and Security for running the daemon without super-user privileges.