Skip to content

Commit

Permalink
change automated to manual gpu vendor selection
Browse files Browse the repository at this point in the history
  • Loading branch information
NevermindNilas committed Jun 20, 2024
1 parent c23f92d commit 8c3cd74
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
31 changes: 10 additions & 21 deletions benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@
import subprocess
import platform


def figureOutGPUVendor():
try:
with open("log.txt", "r") as file:
lines = file.readlines()
for line in lines:
if "NVIDIA" in line or "nvidia" in line:
return "NVIDIA"
if "AMD" in line or "amd" in line:
return "AMD"
except Exception as e:
print("Error figuring out GPU vendor:", e)


def runAllBenchmarks(executor, version, inputVideo=None):
print(
"Running all benchmarks. Depending on your system, this may take a while. Please be patient and keep the terminal in focus at all time."
Expand Down Expand Up @@ -221,7 +207,14 @@ def parseSystemInfo():
currentTest = 0
executor, version = getExe()
inputVideo = getClip(executor)
GPUVENDOR = figureOutGPUVendor()

while True:
GPUVENDOR = input("Please enter your GPU vendor (NVIDIA, AMD, Intel): ").upper()
if GPUVENDOR in ["NVIDIA", "AMD", "INTEL"]:
break
else:
print(f"Invalid GPU vendor, >>> {GPUVENDOR} <<< is not a valid option. Please try again.")

if GPUVENDOR == "NVIDIA":
upscaleMethods = [
method
Expand All @@ -233,7 +226,7 @@ def parseSystemInfo():
for method in interpolateMethods
if "ncnn" not in method and "directml" not in method
]
elif GPUVENDOR == "AMD":
elif GPUVENDOR == "AMD" or GPUVENDOR == "INTEL":
upscaleMethods = [
method
for method in upscaleMethods
Expand All @@ -243,18 +236,14 @@ def parseSystemInfo():
method
for method in interpolateMethods
if "ncnn" in method or "directml" in method
]
elif GPUVENDOR == "Intel":
pass

]

if platform.system() == "Linux":
upscaleMethods = [
method for method in upscaleMethods if "directml" not in method
]

TOTALTESTS = len(upscaleMethods) + len(interpolateMethods) * 2

print(f"GPU Vendor: {GPUVENDOR}")
print(f"Total models to benchmark: {TOTALTESTS}")
print(f"Using {executor} version {version}")
Expand Down
4 changes: 2 additions & 2 deletions src/unifiedInterpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ def run(self, frame, interpolateFactor, writeBuffer):
if self.sceneChangeProcess.run(self.I0, self.I1):
for _ in range(interpolateFactor - 1):
writeBuffer.write(frame)
self.cacheFrameReset()
self.stream.synchronize() if self.isCudaAvailable else None
self.cacheFrameReset()
self.sceneChangeProcess.cacheFrame()
return

Expand Down Expand Up @@ -419,8 +419,8 @@ def run(self, frame, interpolateFactor, writeBuffer):
if self.sceneChangeProcess.run(self.I0, self.I1):
for _ in range(interpolateFactor - 1):
writeBuffer.write(frame)
self.cacheFrame()
self.stream.synchronize()
self.cacheFrame()
self.sceneChangeProcess.cacheFrame()
return

Expand Down

0 comments on commit 8c3cd74

Please sign in to comment.