if (require('os').platform === "darwin") {
document.getElementById("gpuinfo").style.display = "none";
}
if (require('os').platform !== "darwin") {
gpuinfo = require('@electron/remote').app.getGPUFeatureStatus();
gpuscore = 0;
maxscore = 10;
if (gpuinfo['2d_canvas'].startsWith("enabled")) {
if (gpuinfo['2d_canvas'] === "enabled") {
gpuscore++;
} else {
gpuscore += 0.5;
}
}
if (gpuinfo['gpu_compositing'].startsWith("enabled")) {
if (gpuinfo['gpu_compositing'] === "enabled") {
gpuscore++;
} else {
gpuscore += 0.5;
}
}
if (gpuinfo['video_decode'].startsWith("enabled")) {
if (gpuinfo['video_decode'] === "enabled") {
gpuscore++;
} else {
gpuscore += 0.5;
}
}
if (gpuinfo['multiple_raster_threads'].startsWith("enabled")) {
if (gpuinfo['multiple_raster_threads'] === "enabled") {
gpuscore++;
} else {
gpuscore += 0.5;
}
}
if (gpuinfo['oop_rasterization'].startsWith("enabled")) {
if (gpuinfo['oop_rasterization'] === "enabled") {
gpuscore++;
} else {
gpuscore += 0.5;
}
}
if (gpuinfo['rasterization'].startsWith("enabled")) {
if (gpuinfo['rasterization'] === "enabled") {
gpuscore++;
} else {
gpuscore += 0.5;
}
}
if (gpuinfo['opengl'].startsWith("enabled")) {
if (gpuinfo['opengl'] === "enabled") {
gpuscore++;
} else {
gpuscore += 0.5;
}
}
if (gpuinfo['skia_renderer'].startsWith("enabled")) {
if (gpuinfo['skia_renderer'] === "enabled") {
gpuscore++;
} else {
gpuscore += 0.5;
}
}
if (gpuinfo['vulkan'].startsWith("enabled")) {
if (gpuinfo['vulkan'] === "enabled") {
gpuscore++;
} else {
gpuscore += 0.5;
}
}
if (gpuinfo['webgl'].startsWith("enabled")) {
if (gpuinfo['webgl'] === "enabled") {
gpuscore++;
} else {
gpuscore += 0.5;
}
}
gpuperct = (gpuscore/maxscore)*100;
document.getElementById("gpusupportperc").innerText = gpuperct + "%";
document.getElementById("gpuinfo_progressbar").style.width = gpuperct + "%";
if (gpuperct < 50) {
document.getElementById("gpuinfo_progressbar").style.background = "rgba(128, 0, 0, .5)";
} else if (gpuperct < 75) {
document.getElementById("gpuinfo_progressbar").style.background = "rgba(128, 128, 0, .5)";
} else {
document.getElementById("gpuinfo_progressbar").style.background = "rgba(0, 128, 0, .5)";
}
}
if (require('os').platform !== "darwin") {
gpuinfo = require('@electron/remote').app.getGPUFeatureStatus();
document.write("kartik
");
document.write("├ kartik.accel
");
if (gpuinfo['2d_canvas'].startsWith("enabled")) {
document.write("│ ├ kartik.accel.Canvas
");
} else {
document.write("│ ├ kartik.accel.Canvas
");
}
if (gpuinfo['gpu_compositing'].startsWith("enabled")) {
document.write("│ ├ kartik.accel.Compositing
");
} else {
document.write("│ ├ kartik.accel.Compositing
");
}
if (gpuinfo['video_decode'].startsWith("enabled")) {
document.write("│ └ kartik.accel.VideoDecode
");
} else {
document.write("│ └ kartik.accel.VideoDecode
");
}
document.write("├ kartik.raster
");
if (gpuinfo['multiple_raster_threads'].startsWith("enabled")) {
document.write("│ ├ kartik.raster.Threaded
");
} else {
document.write("│ ├ kartik.raster.Threaded
");
}
if (gpuinfo['oop_rasterization'].startsWith("enabled")) {
document.write("│ ├ kartik.raster.ObjectOP
");
} else {
document.write("│ ├ kartik.raster.ObjectOP
");
}
if (gpuinfo['rasterization'].startsWith("enabled")) {
document.write("│ └ kartik.raster.Common
");
} else {
document.write("│ └ kartik.raster.Common
");
}
document.write("└ kartik.renderer
");
if (gpuinfo['opengl'].startsWith("enabled")) {
document.write(" ├ kartik.renderer.OpenGL
");
} else {
document.write(" ├ kartik.renderer.OpenGL
");
}
if (gpuinfo['webgl'].startsWith("enabled")) {
document.write(" ├ kartik.renderer.WebGL
");
} else {
document.write(" ├ kartik.renderer.WebGL
");
}
if (gpuinfo['skia_renderer'].startsWith("enabled")) {
document.write(" ├ kartik.renderer.Skia
");
} else {
document.write(" ├ kartik.renderer.Skia
");
}
if (gpuinfo['vulkan'].startsWith("enabled")) {
document.write(" └ kartik.renderer.Vulkan
");
} else {
document.write(" └ kartik.renderer.Vulkan
");
}
} else {
document.write("You are using macOS
Kartik can't detect GPU info
for Apple macOS.");
}
document.onkeydown = (e) => {
if (e.shiftKey) {
document.getElementById('gpuinfo-inner').style.opacity = "1";
document.getElementById('gpuinfo-inner').style.height = "max-content";
document.getElementById('gpuinfo-outer').style.display = "none";
} else {
document.getElementById('gpuinfo-inner').style.opacity = "0";
document.getElementById('gpuinfo-inner').style.height = "0";
document.getElementById('gpuinfo-outer').style.display = "";
}
}
document.onkeyup = (e) => {
document.getElementById('gpuinfo-inner').style.opacity = "0";
document.getElementById('gpuinfo-inner').style.height = "0";
document.getElementById('gpuinfo-outer').style.display = "";
}
require('systeminformation').graphics().then((data) => {
document.getElementById("gpuinfo-model").innerText = data.controllers[0].model;
vram = data.controllers[0].vram;
if (vram > 1024) {
vrams = (vram/1024).toFixed(1) + " GiB";
} else {
vrams = (vram).toFixed(1) + " MiB";
}
document.getElementById("gpuinfo-vram").innerText = vrams + " VRAM";
})