Skip to content

Commit 6623852

Browse files
committed
NVIDIA CUDA Linux pipeline
1 parent 5e4473e commit 6623852

9 files changed

+50
-4
lines changed

src/main/java/org/dpsoftware/config/Constants.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ public class Constants {
287287
public static final String MQTT_ERROR_TITLE = "mqtt.error.title";
288288
public static final String MQTT_ERROR_HEADER = "mqtt.error.header";
289289
public static final String MQTT_ERROR_CONTEXT = "mqtt.error.context";
290+
public static final String CUDA_ERROR_TITLE = "cuda.error.title";
291+
public static final String CUDA_ERROR_HEADER = "cuda.error.header";
292+
public static final String CUDA_ERROR_CONTEXT = "cuda.error.context";
290293
public static final String START = "tray.icon.start";
291294
public static final String STOP = "tray.icon.stop";
292295
public static final String STOP_STR = "STOP";
@@ -316,6 +319,7 @@ public class Constants {
316319
public static final String CAPTURE_MODE_CHANGED = "capture.mode.changed";
317320
public static final String GITHUB_URL = "https://github.com/sblantipodi/firefly_luciferin/releases";
318321
public static final String WEB_INSTALLER_URL = "https://sblantipodi.github.io/glow_worm_luciferin";
322+
public static final String LINUX_WIKI_URL = "https://github.com/sblantipodi/firefly_luciferin/wiki/Linux-support#nvidia-cuda";
319323
public static final String TITLE_BAR_SELECTOR = "#titleBarLabel";
320324
@SuppressWarnings("all")
321325
public static final String HTTP = "http://";
@@ -644,6 +648,8 @@ public class Constants {
644648
public static final int CMD_WAIT_DELAY = 10000;
645649
public static final int SPAWN_INSTANCE_WAIT_DELAY = 1000;
646650
public static final int SPAWN_INSTANCE_WAIT_START_DELAY = 3000;
651+
public static final String[] CMD_CUDA_CHECK = {"/bin/sh", "-c", "gst-inspect-1.0 nvcodec | grep cuda"};
652+
public static final String[] CUDA_REQUIRED_PLUGINS = {"cudaupload", "cudascale", "cudaconvert", "cudadownload"};
647653
// Native executor
648654
public static final String CANT_RUN_CMD = "cant.run.cmd";
649655
public static final String NO_OUTPUT = "no.output";

src/main/java/org/dpsoftware/gui/controllers/ModeTabController.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
package org.dpsoftware.gui.controllers;
2323

2424
import javafx.fxml.FXML;
25-
import javafx.scene.control.Button;
26-
import javafx.scene.control.ComboBox;
27-
import javafx.scene.control.Label;
28-
import javafx.scene.control.TextField;
25+
import javafx.scene.control.*;
2926
import javafx.scene.input.InputEvent;
3027
import javafx.util.StringConverter;
3128
import org.dpsoftware.MainSingleton;
@@ -39,7 +36,9 @@
3936
import org.dpsoftware.managers.StorageManager;
4037
import org.dpsoftware.utilities.CommonUtility;
4138

39+
import java.util.List;
4240
import java.util.Locale;
41+
import java.util.Optional;
4342

4443
/**
4544
* Mode Tab controller
@@ -127,6 +126,7 @@ public String toString(Configuration.CaptureMethod object) {
127126
default -> null;
128127
};
129128
}
129+
130130
@Override
131131
public Configuration.CaptureMethod fromString(String string) {
132132
return null;
@@ -261,6 +261,25 @@ public void initListeners() {
261261
settingsController.checkProfileDifferences();
262262
}
263263
});
264+
captureMethod.valueProperty().addListener((ov, oldVal, newVal) -> {
265+
if (newVal.equals(Configuration.CaptureMethod.XIMAGESRC_NVIDIA) || newVal.equals(Configuration.CaptureMethod.PIPEWIREXDG_NVIDIA)) {
266+
List<String> scrProcess = NativeExecutor.runNative(Constants.CMD_CUDA_CHECK, Constants.CMD_WAIT_DELAY);
267+
boolean pluginsFound = true;
268+
for (String plugin : Constants.CUDA_REQUIRED_PLUGINS) {
269+
if (scrProcess.stream().noneMatch(str -> str.trim().contains(plugin))) {
270+
pluginsFound = false;
271+
}
272+
}
273+
if (!pluginsFound) {
274+
Optional<ButtonType> result = MainSingleton.getInstance().guiManager.showAlert(CommonUtility.getWord(Constants.CUDA_ERROR_TITLE), CommonUtility.getWord(Constants.CUDA_ERROR_HEADER),
275+
CommonUtility.getWord(Constants.CUDA_ERROR_CONTEXT), Alert.AlertType.CONFIRMATION);
276+
ButtonType button = result.orElse(ButtonType.OK);
277+
if (button == ButtonType.OK) {
278+
MainSingleton.getInstance().guiManager.surfToURL(Constants.LINUX_WIKI_URL);
279+
}
280+
}
281+
}
282+
});
264283
}
265284

266285
/**

src/main/resources/messagebundle_de.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ serial.port.ambiguos.context=Mehr als ein Gerät sind mit deinen seriellen Ports
262262
mqtt.error.title=MQTT Verbindungsfehler
263263
mqtt.error.header=Es kann keine Verbindung zum MQTT-Server hergestellt werden.
264264
mqtt.error.context=Luciferin kann keine Verbindung zum MQTT-Server herstellen, bitte überprüfe deine Einstellungen und versuche es erneut.
265+
cuda.error.title=Plugin-Fehler
266+
cuda.error.header=GStreamer-Plugins nicht gefunden.
267+
cuda.error.context=Ihr System verfügt nicht über alle erforderlichen Plugins zum Ausführen von NVIDIA CUDA.\nBitte überprüfen Sie das WIKI des Projekts, um zu erfahren, wie Sie alle erforderlichen Abhängigkeiten installieren.
265268
click.ok.download=\nKlicke auf “OK”, um die neue Version herunterzuladen und zu installieren.
266269
click.ok.download.linux=\nKlicke auf “OK”, um die neue Version in \n~/Documents/FireflyLuciferin herunterzuladen.\n
267270
once.download.finished=Sobald der Download abgeschlossen ist,\nwechsle bitte zu diesem Ordner und installiere das Programm manuell.

src/main/resources/messagebundle_en.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ serial.port.ambiguos.context=There is more than one device connected to your ser
262262
mqtt.error.title=MQTT Connection Error
263263
mqtt.error.header=Unable to connect to the MQTT server
264264
mqtt.error.context=Luciferin is unable to connect to the MQTT server, please correct your settings and retry.
265+
cuda.error.title=Plugins error
266+
cuda.error.header=GStreamer plugins not found.
267+
cuda.error.context=Your system does not have all the required plugins to run NVIDIA CUDA.\nPlease check the project's WIKI to learn how to install all the required dependencies.
265268
click.ok.download=\nClick Ok to download and install the new version.
266269
click.ok.download.linux=\nClick Ok to download new version in your\n~/Documents/FireflyLuciferin folder.\n
267270
once.download.finished=Once the download is finished,\nplease go to that folder and install it manually.

src/main/resources/messagebundle_es.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ serial.port.ambiguos.context=Hay más de un dispositivo conectado a los puertos
261261
mqtt.error.title=Error de conexión MQTT
262262
mqtt.error.header=No se pudo conectar al servidor MQTT
263263
mqtt.error.context=Luciferin no puede conectarse al servidor MQTT, por favor, corrija sus ajustes y reinténtelo.
264+
cuda.error.title=Error de plugins
265+
cuda.error.header=Complementos de GStreamer no encontrados.
266+
cuda.error.context=Su sistema no tiene todos los complementos necesarios para ejecutar NVIDIA CUDA.\nConsulte el WIKI del proyecto para saber cómo instalar todas las dependencias necesarias.
264267
click.ok.download=\nPulse OK para descatgar e instalar la nueva versión.
265268
click.ok.download.linux=\nPulse OK para descargar la nueva versión en su carpeta\n~/Documents/FireflyLuciferin.\n
266269
once.download.finished=Cuando haya terminado la descarga,\npor favor, vaya a dicha carpeta e instálelo manualmente.

src/main/resources/messagebundle_fr.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ serial.port.ambiguos.context=Il y a plus d'un appareil connecté a vos ports sé
262262
mqtt.error.title=Érreur de connexion MQTT
263263
mqtt.error.header=Impossible de se connecter au serveur MQTT
264264
mqtt.error.context=Luciferin n'arrive pas à se connecter au serveur MQTT, merci de vérifier vos réglages et de réessayer.
265+
cuda.error.title=Erreur de plugin
266+
cuda.error.header=Plugins GStreamer introuvables.
267+
cuda.error.context=Votre système ne dispose pas de tous les plugins requis pour exécuter NVIDIA CUDA.\nVeuillez consulter le WIKI du projet pour savoir comment installer toutes les dépendances requises.
265268
click.ok.download=\nCliquer sur Ok pour télécharger et installer la nouvelle version.
266269
click.ok.download.linux=\nCliquez sur OK pour télécharger la nouvelle version dans votre répertoire\n~/Documents/FireflyLuciferin\n
267270
once.download.finished=Une fois le téléchargement terminé,\nveuillez accéder à ce dossier et l'installer manuellement.

src/main/resources/messagebundle_hu.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ serial.port.ambiguos.context=Több mint két eszköz kapcsolódik a soros portho
262262
mqtt.error.title=MQTT kapcsolódási hiba
263263
mqtt.error.header=Nem lehet csatlakozni az MQTT szerverhez
264264
mqtt.error.context=Luciferin nem tud csatlakozni az MQTT szerverhez, ellenőrizd a beállításokat és próbáld újra.
265+
cuda.error.title=Plugin hiba
266+
cuda.error.header=A GStreamer bővítmények nem találhatók.
267+
cuda.error.context=Rendszere nem rendelkezik az NVIDIA CUDA futtatásához szükséges összes beépülő modullal.\nKérjük, ellenőrizze a projekt WIKI-jét, hogy megtudja, hogyan telepítheti az összes szükséges függőséget.
265268
click.ok.download=\nAz új verzió telepítéséhez klikkelj az OK-ra.
266269
click.ok.download.linux=\nAz új verziójú \n~/Documents/FireflyLuciferin mappában taláható firmware telepítéséhez klikkelj az OK-ra.\n
267270
once.download.finished=A letöltés végeztével,\n kérlek telepítsed manuálisan a letöltési mappából.

src/main/resources/messagebundle_it.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ serial.port.ambiguos.context=C'è più di un dispositivo connesso sulle porte se
262262
mqtt.error.title=MQTT errore di connessione
263263
mqtt.error.header=Impossibile connettersi al server MQTT
264264
mqtt.error.context=Luciferin non riesce a connettersi al server MQTT. Per favore correggi le impostazioni e riprova.
265+
cuda.error.title=Errore dei plugin
266+
cuda.error.header=Plugin GStreamer non trovati.
267+
cuda.error.context=Il tuo sistema non dispone di tutti i plugin necessari per eseguire NVIDIA CUDA.\nControlla il WIKI del progetto per sapere come installare tutte le dipendenze richieste.
265268
click.ok.download=\nClicca Ok per scaricare e installare la nuova versione.
266269
click.ok.download.linux=\nClicca Ok per scaricare la nuova versione nella seguente\n~/Documents/FireflyLuciferin cartella.\n
267270
once.download.finished=Quando il download sarà terminato,\nvai in quella cartella e installa manualmente.

src/main/resources/messagebundle_ru.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ serial.port.ambiguos.context=К последовательному порту п
262262
mqtt.error.title=MQTT Ошибка подключения
263263
mqtt.error.header=Не удается подключиться к серверу MQTT.
264264
mqtt.error.context=Luciferin не удается подключиться к серверу MQTT, исправьте настройки и повторите попытку.
265+
cuda.error.title=Ошибка плагинов
266+
cuda.error.header=Плагины GStreamer не найдены.
267+
cuda.error.context=В вашей системе нет всех необходимых плагинов для запуска NVIDIA CUDA.\nПожалуйста, проверьте WIKI проекта, чтобы узнать, как установить все необходимые зависимости.
265268
click.ok.download=\nНажмите «ОК», чтобы загрузить и установить новую версию.
266269
click.ok.download.linux=\nНажмите «ОК», чтобы загрузить новую версию в папку \n~/Documents/FireflyLuciferin.\n
267270
once.download.finished=Когда загрузка будет завершена,\nперейдите в эту папку и установите программу вручную.

0 commit comments

Comments
 (0)