-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using multiple GPUs #24
Comments
There's not currently a way to no, but you could interleave every 2nd frame to your 2nd GPU. E.g., near the end of the script use SelectEvery to split the video into 2 video clip variables. I can't say that this will actually improve performance, but why not give it a shot. |
Hmm, I'll try that out. |
Do let me know how it goes, because if it works and shows genuine benefit, then I may add this as an option directly within VSGAN when multiple devices are supplied. |
I just tried it and I got an FPS increase from 7 FPS up to 12. Edit: Accidentally closed this issue lol. |
I don't currently have 2 GPUs in my system so I was wondering if you could send me the important bits of your script that you can confirm it working with, just so I have something to base off of for implementing it directly. |
Sorry for the late answer, here is my script.
|
Yep thats what I expected. If that genuinely did help performance, will implement it directly now. One thing I realized though is for at least ESRGAN and maybe others I could do this job a lot easier by just splitting the workload to different initialized torch devices based on the frame number during |
Take a look at the multi-gpu branch. If you could test that out for me it would be highly appreciated. If you could also ensure that the performance between single and multi-GPU is expected that would be amazing. There's currently no build for it on PyPI (pip install) but you can follow this to install from source (just make sure you install from the right branch): Installing from Source Code Since the docs don't currently build, I will make a brief explanation of the changes here for now. The only change you need to make from a typical usage of VSGAN, is change |
Installed the branch through modifying the AUR package. |
I'm not sure what that error is from, or from here exactly, but I did have a few mistakes propagating from old commits from months ago that I never made into a stable release. I fixed those and updated the multi-gpu branch with the changes as well. Can you try now perhaps? If you get that same error, as much information on it would be great, like where that error was thrown/displayed, and if you have more stack information on it, that would be useful. |
Tried the update, still getting an error.
The error only seems to happen if I use more than one device. Whether it's "cuda:0" and "cuda:1" or "cuda:1" and "cpu!" doesn't matter. The error also doesn't seem to be related to the size of the input in this case, trying it with 144p as input still throws an error. |
The terminate error seems quite strange and is a bit hard to debug, however, the warning about buffer I do know about. Can you try as of cacc016 Also I've added a 2nd GPU for testing and might have fixed/improved stuff since I asked you to retry. On my end I have it working but the current method I'm trying doesn't seem to actually work to improve performance. Likely something relating to threading as it seems to be because the GPUs arent at full load, their graphs are like spikes seemingly due to switching of GPU constantly one at a time. I do have an alternative method based on what I originally mentioned to you, which you have tested working. I have it implemented but its just an overall less ideal method as it feels like a lazy way of doing it. Sadly I just don't know why the more normal method isn't using the GPUs at full load. Will be trying some stuff out. |
I've cleaned both the I've rebased the The terminate error description looks like some form of C/C++ trace log rather than Python which is making me think it could be maybe a VapourSynth crash or something as well. |
I don't seem to get that crash anymore. |
Yeah but effectively that is what I'm doing here, just its lower-level, without the need to split the clips. It's possible some sort of threading optimization is being done with the SelectEvery+Interleave method in comparison. I get just over half the performance of just my single 2080ti when I use both my 2080ti+1080ti with the current method. Yet with the method we first spoke about that you tried and had working, works flawlessly and gets me just slightly under the performance of the two cards solo. Basically the right speed. In task manager only this method is getting my GPUs full load. However, this method is only working if the threads are fast and that the GPU is constantly getting frames, forever. Almost to the point where its overloaded with data. By default on my system It genuinely seems like we just need to start every single frame ASAP and it keeps the GPU up and running fast or something. When my GPUs are like this: I got 1.10~ FPS, about the combined speed of my 2 cards. After an amount of time, depending on core.num_threads, load will eventually be spikey: When this happens my FPS would drop to just under the speed of my 2080ti. It's as if once the threads get consumed fully, they don't really recover and start running one at a time. |
I believe the issue could be that the indifference in computing performance of one GPU which will cause the other one to idle. |
Hey there,
I got two GPUs in my system that I'd like to use for the upscaling process.
Is there any way to get VSGAN to run on both GPUs?
Currently only my primary GPU is getting hit by VSGAN, which leaves a ton of performance on the table.
The text was updated successfully, but these errors were encountered: