You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to utilize 4 gpus for inference with the following code but it didn't work. Only one of the gpu was doing the job at a time and the others were idling. Are there any suggested ways for multi-gpu inference?
import vapoursynth as vs
import os
from vsbasicvsrpp import BasicVSRPP
core = vs.core
folder = r'C:\Users\test\Desktop\vs-58'
file = r'test.m4v'
src = os.path.join(folder, file)
src = core.ffms2.Source(src)
src = core.fmtc.resample (clip=src, css="444")
src = core.fmtc.matrix (clip=src, mat="709", col_fam=vs.RGB)
src = core.fmtc.bitdepth (clip=src, bits=32)
interval = 180
n = 4
add = (interval*n) - len(src) % (interval*n)
if add>0:
src = src + core.std.BlankClip(src, length=add)
c1 = core.std.SelectEvery(clip=src, cycle=interval*n, offsets=[i for i in range(interval*0, interval)])
c1 = BasicVSRPP(c1, model=5, interval=interval, device_index=0, fp16=True)
c2 = core.std.SelectEvery(clip=src, cycle=interval*n, offsets=[i for i in range(interval*1, interval*2)])
c2 = BasicVSRPP(c2, model=5, interval=interval, device_index=1, fp16=True)
c3 = core.std.SelectEvery(clip=src, cycle=interval*n, offsets=[i for i in range(interval*2, interval*3)])
c3 = BasicVSRPP(c3, model=5, interval=interval, device_index=2, fp16=True)
c4 = core.std.SelectEvery(clip=src, cycle=interval*n, offsets=[i for i in range(interval*3, interval*4)])
c4 = BasicVSRPP(c4, model=5, interval=interval, device_index=3, fp16=True)
c = core.std.Interleave(clips=[c1, c2, c3, c4])
a = [i for i in range(interval*n) if i % n ==0] + [i for i in range(interval*n) if i % n ==1] + [i for i in range(interval*n) if i % n ==2] + [i for i in range(interval*n) if i % n ==3]
c = core.std.SelectEvery(clip=c, cycle=interval*n, offsets=a)
c = core.fmtc.matrix (clip=c, mat="709", col_fam=vs.YUV)
c = core.fmtc.resample (clip=c, css="420")
c = core.fmtc.bitdepth(clip =c, bits=16)
if add>0:
c = c[:-add]
c.set_output()
The text was updated successfully, but these errors were encountered:
I tried to utilize 4 gpus for inference with the following code but it didn't work. Only one of the gpu was doing the job at a time and the others were idling. Are there any suggested ways for multi-gpu inference?
The text was updated successfully, but these errors were encountered: