Implement GPU mode

fixes #67

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr
2022-12-04 12:09:58 +01:00
parent d2849a3a4c
commit a0d74e6fb3
10 changed files with 399 additions and 132 deletions

View File

@ -167,6 +167,20 @@ class AdminController extends Controller {
return new JSONResponse(['wasmtensorflow' => true]);
}
public function gputensorflow(): JSONResponse {
try {
exec($this->settingsService->getSetting('node_binary') . ' ' . __DIR__ . '/../../src/test_gputensorflow.js' . ' 2>&1', $output, $returnCode);
} catch (\Throwable $e) {
return new JSONResponse(['gputensorflow' => false]);
}
if ($returnCode !== 0) {
return new JSONResponse(['gputensorflow' => false]);
}
return new JSONResponse(['gputensorflow' => true]);
}
public function cron(): JSONResponse {
$cron = $this->config->getAppValue('core', 'backgroundjobs_mode', '');
return new JSONResponse(['cron' => $cron]);