Giter Site home page Giter Site logo

Comments (3)

MartinPulec avatar MartinPulec commented on August 20, 2024

Hi, thanks for writing.

Can I have some questions? You are saying that you encode 24 FullHD frames 0.05 second. This means 2 ms per frame? This is rather more that I'd expect but I cannot say that it is incorrect, it depends on image and encoder properties. The problem may also be that whether there is "only" 24 images, the GPU initialization doesn't amortize well, to be concrete, CUDA initialization can cost as much as encoding 200 frames.

How much improvement would you imagine by parallel encoding? The thing is that the performance bottleneck is mostly PCIe transfers. I've created example encode.c.txt and some evaluations:

$ time ./encode 8000 1
real    0m8.680s
$ time ./a.out 2000 4
real    0m6.414s
$ time (./a.out 2000 1 & ./a.out 2000 1 & ./a.out 2000 1 & ./a.out 2000 1 & wait)
real    0m5.501s

So running in multiple processes improves the performance by some 36%, multi-threaded something less (there is some space for improvement here). When run within the NVidia Profiler, GPUJPEG performence is limited by memory transfers of uncompressed image to GPU (for encode). From the profiler, I can imagine improvement by, let say, 20% but surely not multiple times. Of course I am writing about images in CPU RAM - if you have or can have them already on GPU, it may be quite a different story.

from gpujpeg.

MartinPulec avatar MartinPulec commented on August 20, 2024

Hi, I've update on the above. I've tweaked the example from my previous post to use pinned memory and now its performance is optimal (it is entirely utilizing host-to-device bandwidth according to NVIDIA profiler), it is here. The point is that the input (raw) image buffer must be allocated with CUDA API to achieve optimal performance, also CUDA streams should be used.

Is the example above something you were looking for or have I misunderstood it somehow? Of course it could be added to GPUJPEG API, including some thread scheduler to create some higher-level API for user but I'd rather keep it simple

from gpujpeg.

MartinPulec avatar MartinPulec commented on August 20, 2024

I am closing for now since I believe that the question was more or less answered (according to my understanding). If not, feel free to reopen the issue.

from gpujpeg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.