Merge pull request #270465 from philiptaron/sideband-socket-path

nixos/nvidia: Set SidebandSocketPath to a user-writable path in `/run`
This commit is contained in:
Franz Pletz 2024-03-26 12:35:55 +01:00 committed by GitHub
commit 774dca168d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -396,6 +396,9 @@ in {
modules = [nvidia_x11.bin];
display = !offloadCfg.enable;
deviceSection =
''
Option "SidebandSocketPath" "/run/nvidia-xdriver/"
'' +
lib.optionalString primeEnabled
''
BusID "${pCfg.nvidiaBusId}"
@ -533,8 +536,14 @@ in {
hardware.firmware = lib.optional cfg.open nvidia_x11.firmware;
systemd.tmpfiles.rules =
lib.optional (nvidia_x11.persistenced != null && config.virtualisation.docker.enableNvidia)
systemd.tmpfiles.rules = [
# Remove the following log message:
# (WW) NVIDIA: Failed to bind sideband socket to
# (WW) NVIDIA: '/var/run/nvidia-xdriver-b4f69129' Permission denied
#
# https://bbs.archlinux.org/viewtopic.php?pid=1909115#p1909115
"d /run/nvidia-xdriver 0770 root users"
] ++ lib.optional (nvidia_x11.persistenced != null && config.virtualisation.docker.enableNvidia)
"L+ /run/nvidia-docker/extras/bin/nvidia-persistenced - - - - ${nvidia_x11.persistenced}/origBin/nvidia-persistenced";
boot = {