oeffentlich:dl4cv-einrichtung
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| oeffentlich:dl4cv-einrichtung [16.01.2023 23:20] – gelöscht - Externe Bearbeitung (Unknown date) 127.0.0.1 | oeffentlich:dl4cv-einrichtung [05.05.2023 12:08] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | ====== Einrichtung von Jupyter Notebooks mit Anaconda, CUDA und Fernzugriff ====== | ||
| + | |||
| + | Diese Anleitung soll die Einrichtung eines Fernzugriffs auf Jupyter Notebooks, die auf einem PC mit Nvidia-Grafikkarte in einem Heimnetzwerk laufen, erläutern. | ||
| + | |||
| + | Als Betriebssystem wird hier [[https:// | ||
| + | |||
| + | Bei der Auswahl der zu installierenden CUDA- und Anaconda-Version sollte außerdem auf die Kompatibilität der mit Anaconda ausgelieferten PyTorch-Version mit der CUDA-Version geachtet werden. In dieser Anleitung werden Anaconda 2022.10 und CUDA 11.7 verwerdet. | ||
| + | |||
| + | ==== Nutzer zur Wheel-Gruppe ==== | ||
| + | < | ||
| + | usermod -aG wheel ' | ||
| + | </ | ||
| + | |||
| + | ===== CUDA ===== | ||
| + | ==== Vorbereitung ==== | ||
| + | |||
| + | < | ||
| + | dnf install -y epel-release gcc kernel-devel-$(uname -r) kernel-headers-$(uname -r) | ||
| + | </ | ||
| + | |||
| + | Eine ausführliche Anleitung ist auf [[https:// | ||
| + | |||
| + | ==== Installation ==== | ||
| + | |||
| + | Auf [[https:// | ||
| + | |||
| + | < | ||
| + | wget https:// | ||
| + | sudo rpm -i cuda-repo-rhel8-11-7-local-11.7.0_515.43.04-1.x86_64.rpm | ||
| + | sudo dnf clean all | ||
| + | sudo dnf -y module install nvidia-driver: | ||
| + | sudo dnf -y install cuda | ||
| + | </ | ||
| + | |||
| + | ===== Anaconda ===== | ||
| + | |||
| + | ==== Installation ==== | ||
| + | |||
| + | Auf der [[https:// | ||
| + | |||
| + | Im Download-Verzeichnis anschließend folgende Befehle ausführen: | ||
| + | |||
| + | < | ||
| + | chmod +x Anaconda3-2022.10-Linux-x86_64.sh | ||
| + | ./ | ||
| + | </ | ||
| + | |||
| + | ==== PyTorch ==== | ||
| + | |||
| + | Nach dem Ausführen des Anaconda-Installationsskriptes muss noch PyTorch mit CUDA-Unterstützung installiert werden. Der passende Befehl kann auf der [[https:// | ||
| + | |||
| + | < | ||
| + | conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia | ||
| + | conda install tensorboard torchvision | ||
| + | </ | ||
| + | |||
| + | ===== Fernzugriff ===== | ||
| + | |||
| + | ==== Installation benötigter Pakete ==== | ||
| + | Zwischen den S | ||
| + | |||
| + | < | ||
| + | dnf install nginx certbot python3-certbot-nginx | ||
| + | systemctl start nginx | ||
| + | systemctl enable nginx | ||
| + | </ | ||
| + | |||
| + | ==== DynDNS einrichten ==== | ||
| + | |||
| + | ==== Systemd-Service für Notebooks anlegen ==== | ||
| + | Um nicht nach jedem Start des Systems Jupyter Notebook händisch starten zu müssen, wird ein Systemd-Service eingerichtet. | ||
| + | |||
| + | ''/ | ||
| + | |||
| + | < | ||
| + | [Unit] | ||
| + | Description=JupyterNotebook | ||
| + | After=syslog.target | ||
| + | After=network.target | ||
| + | |||
| + | [Service] | ||
| + | Type=simple | ||
| + | User=[username] | ||
| + | Group=[groupname] | ||
| + | WorkingDirectory=[directory] | ||
| + | ExecStart=[executable] | ||
| + | Restart=always | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | systemctl start jupyter-notebook | ||
| + | systemctl enable jupyter-notebook | ||
| + | </ | ||
| + | |||
| + | ==== Firewall ==== | ||
| + | < | ||
| + | firewall-cmd --permanent --add-service=http | ||
| + | firewall-cmd --permanent --add-service=https | ||
| + | </ | ||
| + | |||
| + | ==== Proxy-Konfiguration ==== | ||
| + | |||
| + | ''/ | ||
| + | |||
| + | <code nginx> | ||
| + | server { | ||
| + | server_name [domain]; | ||
| + | |||
| + | listen 80; | ||
| + | listen [::]:80; | ||
| + | listen 443 ssl http2; | ||
| + | listen [::]:443 ssl http2; | ||
| + | |||
| + | if ($ssl_protocol = "" | ||
| + | return 301 https:// | ||
| + | } | ||
| + | |||
| + | root / | ||
| + | |||
| + | #add_header Content-Security-Policy " | ||
| + | add_header Strict-Transport-Security " | ||
| + | add_header X-Content-Type-Options nosniff; | ||
| + | add_header X-XSS-Protection "1; mode=block"; | ||
| + | add_header Referrer-Policy " | ||
| + | |||
| + | ssl_certificate | ||
| + | ssl_certificate_key / | ||
| + | |||
| + | #include / | ||
| + | |||
| + | location / { | ||
| + | proxy_pass http:// | ||
| + | proxy_set_header Host $http_host; | ||
| + | proxy_set_header X-Real-IP $remote_addr; | ||
| + | } | ||
| + | |||
| + | access_log | ||
| + | error_log | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | **TODO:** | ||
| + | * DynDNS-Einrichtung | ||
| + | * tls-config ersetzen | ||
| + | * CSP | ||
| + | * Domains verallgemeinern | ||
| + | |||
| + | |||
