Skip to content
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

Low GPU usage and low FPS. #49

Open
sieuwe1 opened this issue Nov 2, 2020 · 1 comment
Open

Low GPU usage and low FPS. #49

sieuwe1 opened this issue Nov 2, 2020 · 1 comment

Comments

@sieuwe1
Copy link

sieuwe1 commented Nov 2, 2020

Hi @PingoLH

I have changed test.py to run on a video. See implementation below:

device, model = init_model(args)
 proc_size = eval(args.size)

 cap = cv2.VideoCapture("/home/sieuwe/Downloads/Garmin Dash Cam 55 Video Sample (Highway) _ 1080p 30fps (HDR).mp4")

 while(True):

     begin = time.perf_counter()
     ret, frame = cap.read()
     img_raw, decoded = process_img(frame, proc_size, device, model)
     cv2.imshow("OUT",decoded)
     cv2.imshow("IN",img_raw)
     end = time.perf_counter()
     print("fps", 1 / (end - begin))

     if cv2.waitKey(1) & 0xFF == ord('q'):
         break

 cap.release()
 cv2.destroyAllWindows()

I am running a GTX1080 and thus expected a FPS of around 40. I however got a much lower fps of 21. When looking at my GPU util in nvidia-smi I see that it only uses 10% of my gpu. How can I increase the GPU util to get higher FPS.

Using CUDA 10.2 on Ubunut 18.04 with pytorch version 1.4.0

Thanks for your help

Sieuwe

@cao-nv
Copy link

cao-nv commented Nov 24, 2020

Actually, the reported FPS was calculated with only the model time and post-processing time, not the entire pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants