« RetroArch » : différence entre les versions
Aller à la navigation
Aller à la recherche
(→Base) |
|||
| Ligne 25 : | Ligne 25 : | ||
lxc.cgroup2.devices.allow: c 226:128 rwm | lxc.cgroup2.devices.allow: c 226:128 rwm | ||
lxc.mount.entry: /dev/tty10 dev/tty8 none bind,optional,create=file | lxc.mount.entry: /dev/tty10 dev/tty8 none bind,optional,create=file | ||
lxc. | lxc.cgroup2.devices.allow: c 4:10 rwm | ||
lxc.mount.entry: /dev/tty19 dev/tty0 none bind,optional,create=file | lxc.mount.entry: /dev/tty19 dev/tty0 none bind,optional,create=file | ||
lxc. | lxc.cgroup2.devices.allow: c 4:19 rwm | ||
lxc.idmap: u 0 100000 65536 | lxc.idmap: u 0 100000 65536 | ||
lxc.idmap: g 0 100000 44 | lxc.idmap: g 0 100000 44 | ||
Version du 2 novembre 2021 à 13:50
Réglage ProxMox
Sur le serveur hôte il faut activer activer la fonction DRM KMS du module NVidia :
proxmox:~# vi /etc/default/grub
... GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt intel_pstate=active nvidia-drm.modeset=1" ...
proxmox:~# update-grub
On redémarre le serveur.
Réglage LXC
Source Depuis le serveur hôte, avec pour exemple le conteneur 101 :
proxmox:~# vi /etc/pve/lxc/101.conf
... lxc.mount.entry: /dev/dri/card1 dev/dri/card0 none bind,optional,create=file,mode=0666 lxc.cgroup2.devices.allow: c 226:1 rwm lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file lxc.cgroup2.devices.allow: c 226:128 rwm lxc.mount.entry: /dev/tty10 dev/tty8 none bind,optional,create=file lxc.cgroup2.devices.allow: c 4:10 rwm lxc.mount.entry: /dev/tty19 dev/tty0 none bind,optional,create=file lxc.cgroup2.devices.allow: c 4:19 rwm lxc.idmap: u 0 100000 65536 lxc.idmap: g 0 100000 44 lxc.idmap: g 44 44 1 lxc.idmap: g 45 100045 57 lxc.idmap: g 107 103 1 lxc.idmap: g 108 100108 65428
proxmox:~# vi /etc/subgid
... root:44:1 root:103:1
Il faut démarrer ou redémarrer le conteneur et ajouter "root" aux groupes mappés :
lxc101:~# usermod --append --groups video,render root lxc101:~# exec su -l $USER
lxc.mount.entry: /dev/dri/card1 dev/dri/card0 none bind,optional,create=file lxc.cgroup2.devices.allow: c 226:1 rwm lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file lxc.cgroup2.devices.allow: c 226:128 rwm #lxc.mount.entry: /dev/tty10 dev/tty8 none bind,optional,create=file #lxc.cgroup2.devices.allow: c 4:10 rwm #lxc.mount.entry: /dev/tty11 dev/tty0 none bind,optional,create=file #lxc.cgroup2.devices.allow: c 4:11 rwm
GPU NVidia
Voir partage d'une carte graphique NVidia avec un conteneur LXC
Installation
# apt update && apt upgrade
Base
# apt install x11vnc plasma-desktop lightdm build-essential libglvnd-dev pkg-config konsole xterm lightdm-gtk-greeter
https://virtualgl.org/Documentation/HeadlessNV
# nvidia-xconfig -a --allow-empty-initial-configuration --use-display-device=None --virtual=1920x1080 --busid 47:00.0 --use-display-device="DFP-0" --connected-monitor="DFP-0"
X11 & Lightdm
# vi /etc/systemd/system/x11vnc.service
[Unit] Description=VNC Server for X11 Requires=lightdm.service After=syslog.target network-online.target ##optional for better performance Wants=syslog.target network-online.target ##optional for better performance [Service] ExecStart=/usr/bin/x11vnc -auth guess -display :8 -rfbauth /etc/x11vnc.pwd -shared -forever -o /var/log/x11vnc.log ExecStop=/usr/bin/x11vnc -R stop Restart=on-failure RestartSec=2 [Install] WantedBy=multi-user.target
# vi /etc/lightdm/lightdm.conf.d/local_lightdm.conf
[LightDM] minimum-display-number=8 minimum-vt=8
# vi /etc/X11/Xwrapper.config
... allowed_users=anybody
# x11vnc -storepasswd /etc/x11vnc.pwd
# systemctl daemon-reload # systemctl enable x11vnc.service # systemctl enable lightdm
SunShine
# apt install cmake gcc-10 g++-10 libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libevdev-dev # apt install libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev # apt install libdrm-dev libcap-dev # apt install libwayland-dev
# apt install nvidia-cuda-dev nvidia-cuda-toolkit
# apt install libgbm1 git
# cd /usr/local/
# git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules
# cd sunshine && mkdir build && cd build
# cmake -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 ..
# make -j ${nproc}
# vi /etc/udev/rules.d/85-sunshine-input.rules
KERNEL=="uinput", GROUP="input", MODE="0660"
# setcap cap_sys_admin+p /usr/local/sunshine/build/sunshine # usermod -a -G input $USER
lxc.mount.entry: /dev/dri/card1 dev/dri/card0 none bind,optional,create=file lxc.cgroup.devices.allow: c 226:1 rwm lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file lxc.cgroup.devices.allow: c 226:128 rwm # tty8 will be the "display" # EDIT: be sure to mount it onto a host tty >= 10 or the host's monitor will be unusable while running lxc.mount.entry: /dev/tty10 dev/tty8 none bind,optional,create=file lxc.cgroup.devices.allow: c 4:10 rwm lxc.mount.entry: /dev/tty11 dev/tty0 none bind,optional,create=file lxc.cgroup.devices.allow: c 4:11 rwm lxc.mount.entry: /dev/uinput dev/uinput none bind,optional,create=file lxc.cgroup.devices.allow: c 10:223 rwm lxc.mount.entry: /dev/input dev/input none bind,create=dir 0 0 lxc.cgroup.devices.allow: c 13:* rwm