Libjpeg-turbo 1.0 beta Released!

Add any particular hints or tricks you have found to help with your ZoneMinder experience.
aklettke
Posts: 4
Joined: Fri Jan 29, 2010 12:02 am

Libjpeg-turbo 1.0 beta Released!

Post by aklettke »

Libjpeg-turbo 1.0 is a hugely optimized version of the shared library libjpeg that provides MASSIVE performance gains over the standard libjpeg.

Since upgrading to this shared library from the standard libjpeg, we have seen a full 50% decrease in CPU load on our Zoneminder server recording 26+ cameras. This is a HUGE performance gain, and has saved us from having to buy beefier hardware to add more cameras.

Get it here:
http://sourceforge.net/projects/libjpeg-turbo/files/
whatboy
Posts: 304
Joined: Mon Aug 31, 2009 10:31 pm

Post by whatboy »

I installed... I think... don't see any difference... :(
trasherdk
Posts: 12
Joined: Sat Feb 20, 2010 6:20 am

Post by trasherdk »

Hmm, i installed it too.

zmc is still using 8-10 % CPU, but zma went from 9-11 % CPU
to 11-25 % CPU.

Memory is the same.
Enjoy

TrasherDK
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Post by knight-of-ni »

The libjpeg-turbo website only shows version 0.90 available for download, rather than 1.0. Will 1.0 be posted soon or is 0.90 really the latest version?
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Post by mastertheknife »

I'm using this for few months now and definitely saw a drop in cpu load:
http://www.virtualgl.org/DeveloperInfo/Libjpeg

Is your link the same or newer?
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Post by knight-of-ni »

The link I was referring to is this one:
http://sourceforge.net/projects/libjpeg-turbo/files/

The author has recently moved most everything from the previous location over to sourceforge.

At this location, the latest version appears to be 0.90.
dcommander
Posts: 3
Joined: Mon Mar 01, 2010 12:19 am

Post by dcommander »

0.0.90 is the same as 1.0.0 beta 1. It is common practice in open source development for beta versions to be numbered {last major release}.0.{very high number}. This is because packaging software generally doesn't know how to handle version numbers with letters, such as "1.0.0beta1". If there's a second beta, then it will be 0.0.91, etc. until we bump the version to 1.0.0 for the final release.

libjpeg-turbo is not automatically activated when you install it. You have to either manipulate LD_LIBRARY_PATH to use the new libraries (preferred) or replace the sym links in /usr/lib[64] to point to the new libraries. This is by design, because I don't want a million people screaming at me for installing over their system's version of libjpeg. See README-turbo.txt for more details (that file is in /usr/share/doc/libjpeg-turbo-{version} on Linux systems.)

Please see http://libjpeg-turbo.virtualgl.org for further information, including links to our mailing lists.

DRC
whatboy
Posts: 304
Joined: Mon Aug 31, 2009 10:31 pm

Post by whatboy »

I install it with /usr not /usr/local so no... it didn't work for moi!!!
dcommander
Posts: 3
Joined: Mon Mar 01, 2010 12:19 am

Post by dcommander »

If you are building from the 0.0.90 source, then the default prefix is /opt/libjpeg-turbo, not /usr/local. I really discourage trying to install it in /usr. There are too many possible problems that might arise from doing that. One of the most prominent is that autotools has a default library path of "lib", not "lib64", so if you were trying to install a 64-bit version on a RedHat-type system, you'd have to do 'make install prefix=/usr libdir=/usr/lib64'. The other issue is that I don't really know what your existing install of libjpeg looks like. I could imagine a scenario in which the libjpeg-turbo files were named slightly differently and thus didn't completely replace the existing install.

Your best bet is to install one of the pre-built binary packages and follow the instructions in README-turbo.txt.
zylantha
Posts: 8
Joined: Mon Feb 27, 2006 10:36 pm

Post by zylantha »

whatboy wrote:I install it with /usr not /usr/local so no... it didn't work for moi!!!
It works for me, after a bit of trial and error.

The thing not to forget about with 64-bit is that the lib directory is /usr/lib64 not /usr/lib.

When creating your symlinks in accordance with the directions in README-turbo.txt, you need to remember to put them in /usr/lib64 not in /usr/lib. Once I did this, CPU usage dropped from 53% to 10% (recording only - no motion detection).

These libraries are indeed excellent, even cambozola's display of events in the web interface seems to be faster and smoother.
MarcoP
Posts: 46
Joined: Wed Mar 24, 2010 1:46 pm

Post by MarcoP »

I've installed the rpm and after few minutes the total load was over 3.
So I've decided to rebuilt src.rpm using prefix and libdir according to my distro.

AMD 64 CPU usage

Record
libjpeg: 12%
libjpeg-turbo: 8%

Modect
ligjpeg: from memory Idle was 12%, Alerts and Alarms were 18-25%
libjpeg-turbo: Idle 7-8%, Alert-Alarm 12-14% with spikes of 17-21%

Today is windy and all my cameras are detecting motion.
4 local cameras @10FPS (max 10FPS in alarm) 480x360 color.

So yeah, in my case SSE2 support does improve things! Thanks
dcommander
Posts: 3
Joined: Mon Mar 01, 2010 12:19 am

Post by dcommander »

Forgive me if I'm misunderstanding you, but I get the sense that you were expecting that just installing the libjpeg-turbo RPM would automatically accelerate libjpeg. It doesn't work that way. For obvious reasons, the libjpeg-turbo RPM does not presume to overwrite the system's version of libjpeg. Thus, once you have installed the RPM, you have to either manipulate the sym links in /usr/lib[64] or use LD_LIBRARY_PATH to load libjpeg-turbo instead of libjpeg at run time. This is all described in the README file.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Post by knight-of-ni »

The following is one example, specific to Zoneminder, of what dcommander is saying. Find the line in your /etc/init.d/zm script that says "$command start" and place the following just prior to that.

For 64 bit systems:

Code: Select all

export LD_LIBRARY_PATH=/opt/libjpeg-turbo/lib64:$LD_LIBRARY_PATH
For 32 bit systems:

Code: Select all

export LD_LIBRARY_PATH=/opt/libjpeg-turbo/lib:$LD_LIBRARY_PATH
dktr
Posts: 2
Joined: Mon Apr 26, 2010 8:59 pm
Location: PL

Post by dktr »

libjpeg.so.62 , montage all
8 x bt878, 8x15fpx
AMD Athlon(tm) 7550 Dual-Core Processor

92% CPU load,

libjpeg-turbo = 49% LOAD!!!
johnnytolengo
Posts: 184
Joined: Tue Oct 14, 2008 5:59 pm

Post by johnnytolengo »

is it there some guide how to install it in ubutu server karmic 32bit?


Thx.

Jt
Post Reply