refactor: gpu support and docker setup improvements

- Add gpu status refresh with useEffect
- Update docker-compose.yml configuration
- Modify gpu setup scripts
- Improve gpu support checks
This commit is contained in:
vishalkadam47
2024-11-11 23:18:24 +05:30
parent 66c4d8f118
commit b817b4b6ee
3 changed files with 43 additions and 15 deletions

View File

@@ -11,7 +11,7 @@ import {
import { api } from "@/utils/api";
import { TRPCClientError } from "@trpc/client";
import { CheckCircle2, Cpu, Loader2, RefreshCw, XCircle } from "lucide-react";
import { useState } from "react";
import { useEffect, useState } from "react";
import { toast } from "sonner";
interface GPUSupportProps {
@@ -54,9 +54,18 @@ export function GPUSupport({ serverId }: GPUSupportProps) {
const handleRefresh = async () => {
setIsRefreshing(true);
await refetch();
setIsRefreshing(false);
try {
await utils.settings.checkGPUStatus.invalidate({ serverId });
await refetch();
} catch (error) {
toast.error("Failed to refresh GPU status");
} finally {
setIsRefreshing(false);
}
};
useEffect(() => {
handleRefresh();
}, []);
const handleEnableGPU = async () => {
if (serverId === undefined) {

View File

@@ -3,7 +3,6 @@ version: "3.8"
services:
blender:
image: lscr.io/linuxserver/blender:latest
container_name: blender
runtime: nvidia
deploy:
resources: