VideoHelp Forum
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. Now that I have VapourSynth running and everything I tried to setup BasicVSR++. I think I've done the setup correctly, the only thing that remains is that PyTorch is running out of memory. I'm using a RTX 3070 8 GB. I haven't found anything on basicvsr pertaining to the memory configuration, how am I supposed to adjust for this error?

    CUDA out of memory. Tried to allocate 6.59 GiB (GPU 0; 8.00 GiB total capacity; 7.24 GiB already allocated; 0 bytes free; 7.24 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
    Quote Quote  
  2. I haven't found anything on basicvsr pertaining to the memory configuration, how am I supposed to adjust for this error?
    Since you are using Vapoursynth, I assume you are using https://github.com/HolyWu/vs-basicvsrpp, right?
    Assuming you are, you can adjust the tile_..-settings:
    Code:
        tile_x: int = 0,
        tile_y: int = 0,
        tile_pad: int = 16,
    about tiling:
    Since model 3-5 requires the input resolution must be at least 256 and mod-4, you need to make sure every tile's width/height plus padding is also at least 256 and mod-4. When the source's width and height is not divisible by tile_x and tile_y respectively, the last tile's resolution could be less than 256. In your example, 2160 is not divisible by 480, 320 and 392, making the last tile's height 240 and 200. If you had tile_pad=16 set, then 240+16=256 would be fine, but not for the other case.
    see: https://github.com/HolyWu/vs-basicvsrpp/issues/12

    Note that using tiling, the whole process will get slower.

    Alternatively, lower the resolution of your source.

    Cu
    Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. Alright thank you. But source video is 1280x720, which is already mod4. I suppose it's already too much for this process. How do I find the best tiling setting for my hardware, any tips? Naturally I would use the input resolution div2, div4 etc. but do you know if it's better to use square tiles?
    Quote Quote  
  4. I would start with something like 320x360. haven't found any gain/loss form using square vs. non-square tile sizes.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  5. Thank you very much. Now I only need to figure out why vspipe isn't always working. While the preview of vsedit works, the encoding will sometimes simply fail with "vspipe invalid data when processing input". If I'm using mode 3 to 5 there's no such issue.
    Quote Quote  
  6. For me, if I can preview it, then vspipe works fine.
    What does your script look like?
    Are you using your gpu for something else, in parallel, that could cause issues? (like using a gpu based encoder that also used gpu based filtering?)
    Are you running out of ram?
    Might be some virus scanner runnin amok.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  7. I tried doing this so it would end up being 2160p

    Code:
    import vapoursynth as vs
    from vsbasicvsrpp import BasicVSRPP
    core = vs.core
    clip = core.ffms2.Source(source='r2.mp4')
    clip = core.resize.Spline36(clip, 960, 540)
    clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="709")
    clip = BasicVSRPP(clip, tile_x=320, tile_y=360)
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="709")
    clip.set_output()
    Sure the preview takes some time to show up, but there's no reason it should fail. It's not even using 100% of my resources, capping at around 66% CPU usage, 50% RAM and 15% GPU. The encoding simply stops with this error. I'm not running any antivirus software either.
    Quote Quote  
  8. Okay, script looks simple enough. As a side note: the tile height of 360 seems wrong. (my 320x360 suggestion was based on 1280x720)
    Make sure that all vsedit instances and similar are closed, just loading a different source or closing the current source script might not free the vram.
    Also try if it works, if you restrict set interval=1.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  9. In the end I had to lower the tile resolution once more. I'm surprised why the preview and virtualdub would both work with the script I pasted earlier, but the piping to ffmpeg would not. I have to assume that it was just at the threshold for my hardware. Thank you for your help anyway.
    Quote Quote  
  10. How to install BasicVSR++ I am getting the following msg while installing it.

    C:\Users\SACHIN>mim install "mmcv>=2.0.0"
    'mim' is not recognized as an internal or external command,
    operable program or batch file.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!