avatarify-python icon indicating copy to clipboard operation
avatarify-python copied to clipboard

Laptop Dell Inspiron 7000 2 Graphics Card NVIDIA 1060

Open crashoverburn opened this issue 5 years ago • 9 comments

Hello Guys!

First! This is a wonderful work and I am from computer science field I hope can cooperate in something after deploy and test the project on my machine.

I got NVIDIA 1060 with MAX-Q Design with 6GB DDR5 , but my FPS is 1.5, so I believe for some reason is using the onboard Intel card from the laptop.

I got SSD 1 TB and 32 GB RAM

Any thoughts how make the project run on my NVIDIA other than try to use the onboard intel card ?

I think should be something like how to force python opencv to use the GPU Nvidia instead of the onboard intel.

Ps: before you ask I have done the configuration on Windows 10 Graphics Settings and set the priority for python.exe that is in C:\Users\myuser.conda\envs\avatarify to use the 3D NVIDIA High Perform card, but seems to be not working. With this configuration the FPS starts good in the begining with 15 FPS and very good image, then from nothing goes very slow to 1.5 FPS

Best Regards and Success!

crashoverburn avatar Jun 27 '20 13:06 crashoverburn

Do you have cuda installed? What value does "device" have after executing the following code: device = 'cuda' if torch.cuda.is_available() else 'cpu'

rosebbb avatar Jun 30 '20 08:06 rosebbb

Hello rosebbb and thank you for your reply, yes I got nvidia and all cuda installed using gforce experience with the latest driver.

I will ask you to guide me better on this, where are these lines ? Should I need to debug the code with python ? I don't have an idea how to debug this cam_fomm.py on python. If you give me some tips I can try and give you the value of the variable device.

Remember this is a laptop i7 32GB ram and 6GB DDR5 GPU AND (Intel GPU onboard) so the switch is done automatically. I have done the configuration on windows to use python with the heavy GPU. But seems not be to be switching right or start with the heavy GPU and then goes to the Intel one...very weird.

crashoverburn avatar Jun 30 '20 12:06 crashoverburn

Hello,

Please have a look at this screenshot when I first run https://prnt.sc/tbvysa is showing 47 FPS

then after press x goes down to FPS 6 https://prnt.sc/tbvxwn

Can I do any changes to the code to force use of my CUDA NVIDIA 1060 ?

crashoverburn avatar Jul 04 '20 20:07 crashoverburn

6 fps seems about right for a 1060 MaxQ generating a Deepfake with the used model, the 47 fps are displayed when no Deepfake is generated.

mintmaker avatar Jul 13 '20 09:07 mintmaker

Install cuda dev toolkit(This will update your drivers if needed)

https://developer.nvidia.com/cuda-toolkit

Make sure avatarify, miniconda, and cuda tool kit are all installed to the same Drive. you dont need visual studio to use cuda for avatarify.

Cuda enabled is not cuda usable. The toolkit will make it usable.

Seem to be I can't get 15 FPS with nvidia 1060 ?

crashoverburn avatar Jul 16 '20 16:07 crashoverburn

@DRLTAnalysis VRAM generally helps when training something as it allows to look at more input images at the same time (you can fit more images into GPU's memory). At test time it normally isn't the bottleneck as you only have the parameters of the model, input and output. Here tensor and cuda cores can help only. Actually there are some cheaper neural compute sticks out there but these won't make it super fast, because in this model more special operations are computed. But yeah, hardware is currently the most limiting factor.

mintmaker avatar Jul 16 '20 17:07 mintmaker

Hello rosebbb and thank you for your reply, yes I got nvidia and all cuda installed using gforce experience with the latest driver.

I will ask you to guide me better on this, where are these lines ? Should I need to debug the code with python ? I don't have an idea how to debug this cam_fomm.py on python. If you give me some tips I can try and give you the value of the variable device.

Remember this is a laptop i7 32GB ram and 6GB DDR5 GPU AND (Intel GPU onboard) so the switch is done automatically. I have done the configuration on windows to use python with the heavy GPU. But seems not be to be switching right or start with the heavy GPU and then goes to the Intel one...very weird.

Hi sorry for the late reply. From the discussion above, it seems you are using GPU and the fps is just low anyway. But if you want to check, you can the following lines to cam_form.py and see what is printed for the value of device. It seems that cam_form.py has been changed recently.

    device = 'cuda' if torch.cuda.is_available() else 'cpu' 
    print(device)

rosebbb avatar Jul 17 '20 07:07 rosebbb

Hi sorry for the late reply. From the discussion above, it seems you are using GPU and the fps is just low anyway. But if you want to check, you can the following lines to cam_form.py and see what is printed for the value of device. It seems that cam_form.py has been changed recently.

This has been an issue that seems to keep popping up throughout the forum, in that the system ignores the GPU and goes right to CPU causing x(fps)<1 from the lack of CUDA. Not that he was using the GPU, but miniconda/avatarify "ignored" his GPU/CUDA. I saw this problem being pinged up time to time throughout the forums, and even experienced it myself.

3 main things cause this problem. Drivers not being up to date, pathways being changed/or components(CUDA toolkit, miniconda/avatrify) being in different drives, and the developer toolkit not being installed. Once I did this, and only this, the problem resolved. It seems crashoverburn also managed to raise his FPS after I gave him the developer toolkit link to just below 15fps, which is expected for the card.

The biggest thing probably from a user stand point, is file paths changing without them knowing like via update, and how Avatarify will seemingly access CUDA cores without the toolkit initially somehow(This is so weird but it happened to me and him)...and then out of the blue stop accessing it, reverting to CPU, demanding the toolkit.

This is what I've observed personally and constantly through the bug forum when I was trying to figure how to fix his same issue on my end. We actually had the exact same issue and laptop model, his GPU is just a higher model than mine.

Hi learnt a lot from your post. Yeah I think GPU was used given he has 15fps. It is just low and can not achieve >25fps.

Are the three reason you mentioned general problems? Do you observe this issue for other code other than Avatarify?

rosebbb avatar Jul 17 '20 23:07 rosebbb

Please what laptop can I use to run my Avatarify effectively without it lagging?

2babaxy avatar Oct 17 '22 22:10 2babaxy