mirror of
https://git.sanhost.net/sanasol/hytale-f2p
synced 2026-02-26 10:31:47 -03:00
fix: adds EGL env var to detect installed NVIDIA GPU
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
const { execSync } = require('child_process');
|
const { execSync } = require('child_process');
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
function getOS() {
|
function getOS() {
|
||||||
if (process.platform === 'win32') return 'windows';
|
if (process.platform === 'win32') return 'windows';
|
||||||
@@ -217,12 +218,17 @@ function setupGpuEnvironment(gpuPreference) {
|
|||||||
const envVars = {};
|
const envVars = {};
|
||||||
|
|
||||||
if (finalPreference === 'dedicated') {
|
if (finalPreference === 'dedicated') {
|
||||||
envVars.DRI_PRIME = '1';
|
|
||||||
if (detected.vendor === 'nvidia') {
|
if (detected.vendor === 'nvidia') {
|
||||||
envVars.__NV_PRIME_RENDER_OFFLOAD = '1';
|
envVars.__NV_PRIME_RENDER_OFFLOAD = '1';
|
||||||
envVars.__GLX_VENDOR_LIBRARY_NAME = 'nvidia';
|
envVars.__GLX_VENDOR_LIBRARY_NAME = 'nvidia';
|
||||||
envVars.__GL_SHADER_DISK_CACHE = '1';
|
const nvidiaEglFile = '/usr/share/glvnd/egl_vendor.d/10_nvidia.json';
|
||||||
envVars.__GL_SHADER_DISK_CACHE_PATH = '/tmp';
|
if (fs.existsSync(nvidiaEglFile)) {
|
||||||
|
envVars.__EGL_VENDOR_LIBRARY_FILENAMES = nvidiaEglFile;
|
||||||
|
} else {
|
||||||
|
console.warn('NVIDIA EGL vendor library file not found, not setting __EGL_VENDOR_LIBRARY_FILENAMES');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
envVars.DRI_PRIME = '1';
|
||||||
}
|
}
|
||||||
console.log('GPU environment variables:', envVars);
|
console.log('GPU environment variables:', envVars);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user