CPU usage on Dual CPU systems

Discussion about Avi2Dvd.
Requests and bug fixing.

Moderators: george, roger_rabbit, reburn, Excalibur!, skyheartblue

3xH
Junior Member
Posts: 7
Joined: Sun Dec 11, 2005 11:41 pm

CPU usage on Dual CPU systems

Post by 3xH »

When I am encoding with Avi2Dvd, the Avi2Dvd process uses up 50% CPU time which is 100% of 1 CPU. Why is the avi2dvd EXE using so much CPU time? This isn't correct is it? :?:
sethg
Junior Member
Posts: 13
Joined: Wed Dec 07, 2005 9:12 pm
Location: Verona, WI US
Contact:

Post by sethg »

They're software codecs. It sounds right to me. If it used less CPU by lowering the priority, it would just take longer.
3xH
Junior Member
Posts: 7
Joined: Sun Dec 11, 2005 11:41 pm

Post by 3xH »

sethg wrote:They're software codecs. It sounds right to me. If it used less CPU by lowering the priority, it would just take longer.
no, NOT the encoder, AVI2DVD uses 100% CPU time WAITING for the encoders (freeenc) to finish, this is wrong.
sethg
Junior Member
Posts: 13
Joined: Wed Dec 07, 2005 9:12 pm
Location: Verona, WI US
Contact:

Post by sethg »

And the freeenc encoders you mentioned are software, correct?
3xH
Junior Member
Posts: 7
Joined: Sun Dec 11, 2005 11:41 pm

Post by 3xH »

sethg wrote:And the freeenc encoders you mentioned are software, correct?
Yes

I dont think you understand.

In task manager, it lists all the processes that are running, Freenc.exe is its OWN process, its encoding, so yes, it will be using CPU power.

Avi2Dvd.exe is ANOTHER process, its idle, its a front end, all it does is OPEN freeenc, then wait, then open the next program, then wait etc.

There is no way on earth the AVI2DVD frontend should be using 2.2GHz of cpu power just WAITING for freeenc.exe to finish what it is doing.
sethg
Junior Member
Posts: 13
Joined: Wed Dec 07, 2005 9:12 pm
Location: Verona, WI US
Contact:

Post by sethg »

It appears that I understand. As you said, the encoder is software and is what is using virtually all the CPU. In my original post, I said
They're software codecs. It sounds right to me. If it used less CPU by lowering the priority, it would just take longer.
Codec is short for encoder-decoder, so yes, the software codecs are using all the CPU, as you'd expect. The AVI2DVD framework just generates scripts for other applications that call the codecs, so the AVI2DVD shell doesn't use CPU, but the processes it spawns by virtue of the scipts do.

In any case, the software codecs are the issue. If you want to do this fast, you either need hardware support or make use of the x86 MMX extensions.
3xH
Junior Member
Posts: 7
Joined: Sun Dec 11, 2005 11:41 pm

Post by 3xH »

sethg wrote:It appears that I understand. As you said, the encoder is software and is what is using virtually all the CPU. In my original post, I said
They're software codecs. It sounds right to me. If it used less CPU by lowering the priority, it would just take longer.
Codec is short for encoder-decoder, so yes, the software codecs are using all the CPU, as you'd expect.
No, i have 2 CPU's

freeenc is NOT multithreaded, and is using most of ONE CPU as you said

however,

Avi2DVD is using 100% of the OTHER CPU by itself, and last time i checked, avi2dvd isnt a codec OR encoder, just a frontend. Im not trying to be rude, i just want someone to fix what is clearly a bug.

I will hapilly post screenshots if you dont believe me
sethg
Junior Member
Posts: 13
Joined: Wed Dec 07, 2005 9:12 pm
Location: Verona, WI US
Contact:

Post by sethg »

OK, I misunderstood the situation. It makes sense that the codecs are taking up 100% of one CPU. What seems to be an issue is that the particular type of process wait that AVI2DVD uses becomes a blocking wait when the process it is waiting on runs on another processor. I'm a hardware guy, so I can't tell you which form of process wait call would translate into a non-blocking wait when the active task and the waiting task are on separate processors, though I wouldl be very surprised if there were not such a call available.

It obviously doesn't do this on a single processor system, so it is a peculiarity of the particular form of process wait that AVI2DVD is using. Sounds like TrustFm has to find a form of process wait that doesn't block when the task he's waiting for runs on another processor. I would agree that this is a bug.

Sorry for the confusion. You did say it correctly, I misunderstood what you said.
Last edited by sethg on Mon Dec 12, 2005 8:40 pm, edited 1 time in total.
3xH
Junior Member
Posts: 7
Joined: Sun Dec 11, 2005 11:41 pm

Post by 3xH »

sethg wrote:OK, I misunderstood the situation. It makes sense that the codecs are taking up 100% of one CPU. What seems to be an issue is that the particular type of process wait that AVI2DVD uses becomes a blocking wait when the process it is waiting on runs on another processor. I'm a hardware guy, so I can't tell you which form of process wait call would translate into a non-blocking wait when the active task and the waiting task are on separate processors.

It obviously doesn't do this on a single processor system, so it is a peculiarity of the particular form of process wait that AVI2DVD is using. Sounds like TrustFm has to find a form of process wait that doesn't block when the task he's waiting for runs on another processor.

Sorry for the confusion. You did say it correctly, I misunderstood what you said.
:) like i said, not trying to be rude. I just hope someone takes note of the problem.

It seems what you said makes sence, if i set the affinity so that both processes run on 1 CPU, avi2dvd.exe drops to 0% usage. This is handy to know, but irritating to remember to do it manually like that evey time.
sethg
Junior Member
Posts: 13
Joined: Wed Dec 07, 2005 9:12 pm
Location: Verona, WI US
Contact:

Post by sethg »

No offense taken. I misunderstood what you properly explained and I agree this is a bug.
Post Reply