Thursday, January 03, 2013

The saga of muticore CPUs, core parking, and game performance on Windows 7

There is a major performance issue with games (possible affecting DirectX 9 games more) and generally CPU-intensive applications on Windows 7 / Server 2008 running on modern quad-core CPU's due to an obscure power-saving feature called CPU core parking. The symptoms are a dramatic decrease in performance with unstable and jittery in-game FPS and very noticeably laggy and jittery and unresponsive gameplay despite -- and this is the key point -- a high-end graphics card and CPU more than capable of running the game at its max settings and a low server-to-client ping (~100ms) in multiplayer games. The unique performance problems caused by this issue do not resemble typical underpowered hardware issues. People have described the problems as micro-stuttering -- fractional pauses when rendering a frame that are hard to pin down precisely but are definitely noticeable and very detrimental to game enjoyment. For single-player games like RAGE what was most noticeable to me was the display lag when first rendering new scenes. RAGE uses a unique graphics system that requires constant shoveling of texture data from disk to memory to the GPU...the performance problem I had wasn't exactly a low FPS but a noticeable delay in loading texture data that caused my FPS to drop for a second or two as the camera moved through a new scene for the first time.

For multiplayer games that suffer from this issue -- in my case Team Fortress 2 and Planetside 2 -- it appears to all the world (and more importantly to the other players on your server) that you're running a very old obsolete CPU. Gameplay is laggy and jittery especially with many other players in your field-of-view, despite your very capable GPU and CPU and network connection. This issue has NOTHING to do with how well your game or app is optimized or threaded or whether or not you are utilizing all of your CPU cores when your program is running. It is a semi-common performance issue that affects all CPU-intensive programs on quadcore computers under Windows 7 and possibly Vista; even those games and apps which are not heavily multithreaded. I think I encountered this issue even on a game from 2004 -- Return to Castle Wolfenstein -- which had a constant and very noticeable drop in FPS to around 40 for no apparent reason despite running on a high-end Nvidia discrete GPU.

Most games are not multithreaded enough to take full advantage of 4 or more CPU cores and the performance gains from modern multicore CPUs come from the ability of the OS to delegate other tasks to other cores rather than the game itself efficiently distributing its workload across multiple CPU cores. However this particular CPU power-management feature -- core-parking -- is seriously bugged on recent editions of Windows and affects all games regardless of how well 'optimized' -- as gamers like to say -- the game engine is. In Team Fortress 2 the performance slowdown did seem to become noticeable right at the Halloween TF2 update in 2012. TF2 updates always seem to put more and more performance demands on your PC which isn't really a good thing, but it should not have been as pronounced as what I observed. I don't know if a recent Windows update has exacerbated the core-parking issue with games. In TF2 the symptoms are very laggy and unresponsive game play, despite a low server ping and the game itself reporting high framerates. The internal FPS counter in TF2 reported a constant 60 FPS but I suspect this counter strictly measures the ability of the GPU to put frames on the screen. I'm pretty sure my overall framerate in TF2 was nowhere near 60.

According to one explanation which makes sense to me, newer versions of Windows will power down cores to save power when it thinks the current processor workload can be handled on only one or two cores. But it takes time for cores to be moved from this low-power inactive 'parked' state to an active state for handling threads and this delay can be signficant when handling near real-time workloads like games. Unfortunately it seems that the algortihm Windows uses for this park /wake-up /distribute process isn't balanced or doesn't identify heavy realtime workloads properly, and cores may be getting parked and woken up and threads transferred to them and then parked again over and over, resulting in a serious performance degradation. In computer programming a few ms is like a lifetime as far as performance goes.

The solution is simple -- if you want to play games on Windows disable core parking on your desktop if you have a Core Quad or i5 or i7. There are multiple ways and programs that allow you to do this that are documented on the web, like this: http://forum.notebookreview.com/asus/494232-how-adjust-core-parking-inside-windows-7-a.html This way uses enables the built-in power-management interface to manage the core-parking feature and is probably the better approach than doing registry editing directly.

Programs like this one: http://www.coderbag.com/Programming-C/Disable-CPU-Core-Parking-Utility modify the registry for you. Some programs and guides take the step of actually deleting the relevant power-management keys. I would not recommend actually deleting the registry keys or values since there is no automatic way to recreate them -- renaming them is a better approach.

The end result of disabling core parking for my quad-core PC on TF2 is that on servers with < 100ms ping and 32/32 players my gameplay is smooth as butter with 60 fps most of the time, only dipping with very many players in close proximity. My average CPU usage hovers around 50% and load times for levels are also significantly decreased.

On Planetside 2 using a RenderDistance of 1500, GPUPhysics 1, Terrain and Flora 0 and shadows off with all other graphic settings maxed, I get 30-35 fps in heavy firefights with plenty air and vehicle action. This isn't great but it is playable and my fps does not drop below 30 under any circumstances. I get 35-40 in smaller fights and 45+ in most friendly-only areas with many friendlies in view; a solid 60 fpa at warpgates. It's possible that Planetside 2's notoriety for extremely low frame rates even on current-gen hardware like Nvidia 6xx GPUs and Intel i5 and i7's  may be due largely to this issue with core parking. Whatever minimal power-savings you would get from this CPU core-parking feature are not worth turning your sweet gaming-rig into a crippled laptop.



Tuesday, January 01, 2013

Undergraduphonia

This is the portfolio of poems I submitted for the first creative writing poetry class I ever did with Dr. Jennifer Rahim in UWI. Much of it is only slightly interesting, trite, embarrassing, rushed to submit at the deadline,  partially ripped off from a Black Sabbath / Ozzy Osbourne song...pretty much typical of any 1st undergraduate creative writing class. Fear of Flying was published in Dr. Rahim's compilation for the class Heart-to-Verse: Wordlines. I enjoyed the class just like I did the short story writing class with Dr. Merle Hodge, but these were the only two creative writing courses in the whole English Literature syllabus. Creative writing for whatever reason never had a priority at UWI.


Write A Poem On...
Write a poem on writing.
What, a sonnet on love?
Or a psalm to battle evil,
With a prayer for God above.

A ballad on bacchanal.
 A quaint portrait of home.
 A haiku on existence?
For those souls suffering alone.

An ode to beauty.
An epistle on war.
A sonata on moonlight...
But above all else, write.
For what we write,
Is nothing less than life.



The ‘Just Friends’ Ballad
Now when first you saw that letter
And you asked me who it’s for
I looked into your blank black eyes
And marvelled at what I saw.

You looked so cool and casual
Like Sunday afternoon
I could only jerk my head down
I felt like such a fool

I would have loved to skip this interlude
But my feelings were just a little bit too strong.

Just a little bit too strong.

Tanka
Unstoppable prose
Pause in anticipation.
Hurry laggard eye
Here impatient respite stands:
Pay grammar’s toll and run again.

Daisy and Jay 
Good morning, good morning.

The soldiers are marching
The war’s over today.

The top is down
On our silly great car
The wind blows my scarf
And we hear them say:

Good morning, good morning

The lovers are driving
Feel how the past slips away.
Ten thousand miles of longing
Ten million miles of doubting
In their car they’ve covered today.

The past no longer holds fast.
The fantasies no longer chain.

Good morning, good morning

We still believe in happy endings
Where the soldiers are
That’s where we’re going.


Six-Year-Old Sitting on the Red Steps – A Portrait
All I have are my lunch-kit and my bag.
Shoes laced up tight, a kiss and a Alright…
Eat your lunch eh, don’t throw it away,
Listen to teacher, don’t skylark whole day.

I am innocent, ignorant of good or evil,
Ugly or beautiful,
All children my equal.
A pure smile of welcome for all my chums.
A light empty heart with malice for no one.

But soon they will come,
With their daggers of judgement.
Herd us, segregate us, popularity is the currency.
Our sneaker brands, hair-cuts, eligible for mockery.

Fear of Flying
So then, nine thousand kilometres.
Twice that to go and back.
One hundred and eighty thousand tons of JET-A-1;
Light the candle at two hundred and ten degrees and we’re off.
Three kilometres of tarmac
To barrel down.
4 times the earth’s gravity
As we bend upwards.
With wheels up, flaps down, rudder centre, bank left, VSI rising...
They’ve done this hundreds of times right?
Two hundred thousand pounds of thrust
Blast us through space;
At Mach oh-point-eight – altitude forty thousand meters...
That’s a long way down...
For four hundred aunts, uncles, cousins, and comedians,
Serial killers, murderers, rapists and robbers.
5% incidence rate reported among general population
Of Agoraphobia, schizophrenia, dementia, paranoia.
Deported, divorce, laid-off, no breakfast, four hour delay, another Scotch, 
Turbofans, turbulence, fuse short-circuits.
Autopilot, radar, ILS malfunctions.
Emergency, black box, NTSB investigates.

Safer than driving right?

Saturday, October 29, 2011

Martyrs: Film parody


I had no other purpose in mind than telling a story I felt connected to, doing a film I had faith in, and doing it with all my heart. When I was writing MARTYRS, I couldn't see another way to talk about all the things that were surrounding me. On a metaphorical way, horror was the perfect tool to react to the feeling I had, like a sad intuition, that the world we're living in right now is a brutal and unfair one. I mean, very brutal. It seems that the cynism and the power of the winners has killed everything. It seems that our urban societies are more than ever driven by the forces of jungle laws, by rules created by the strongest and the dominant people. I'm not saying anything original about injustice of our times, but it was strong enough in me to create the necessity of doing that film. The system creates a lot of losers, a lot of suffering weak people I feel very close to and MARTYRS in its way tells about them. So I would say that the horror genre is a way to talk about things that preoccupy me a lot. As a fan, I always took the films from the masters Argento, Carpenter, Polanski and dozens of other great artists as their own personal visions of life. That's why I liked them humanly too. And that's why I love horror so much. 
Pascal Laugier

So visionary
I really wish I had known a bit more about the film Martyrs so I could have skipped wasting the 1 and 1/2 hours I put in trying to watch this. Just word-of-mouth that it was supposedly "one of the best horror films ever made" made me decide to watch it. I'm not a fan of horror particularly but I enjoyed being scared by films like The Exorcist and Poltergeist, and I'm interested in good films regardless of genre. I did not catch on to the fact that the same people who were praising Martyrs probably thought that August Underground's Mordum was a masterpiece, and this naivete is what led to the experience I ultimately ended up with.

My experience watching this film was similar to the expereinces I had trying to watch El Topo and 120 days of Sodom and is probably the last attempt I am ever going to make to objectively view or understand anything in this niche of European films. I sat through a huge amount of gratuitous violence, torture, and depravity in the hope that at some point I would begin to find the beginning of the thread the director was trying to spin to at least justify all the crap that had gone before. Once I got to the point where I realized that such a moment was not coming and that despite the director's claim , there was actually no story being told, I stopped watching. In Martyr's case this occurred around 1:20:00. I really wish it had been less.

Martyrs is basically a snuff film that uses a 5 min monologue by a nameless character on a ridiculous paper-thin premise to justify the extended scenes of graphic torture and abuse of young girls.  Here's a synopsis of the film : a shadowy organization systematically drives young girls insane with hideous torture and abuse till they begin to 'see things that others can't'. That's it. fin. If a 16-year old high school student had written the screenplay of Martyrs for a term paper she would have gotten a D-. In this regard it's very similar in execution to 120 Days of Sodom. where depiction of the kidnapping, sexual abuse and murder of a group of teenage girls and boys is justified by the kind of  idiotic liberal moralizing that makes your ears bleed listening to it.

It's society that's killing you, stupid.
It's not the fact that Martyrs is exploitation torture porn that bothers me - there's hundreds of films made and being made like it, and films like Saw and Hostel are constantly trying to push this so-called genre into the mainstream. But the fact that people actually consider this film to have any kind of creative merit says a lot more about human nature than what was depicted in the film.  And it's the cynicism of the director/writer of this film that is a lot more disturbing than watching teenage girls in their underwear getting tortured. So apparently the trend in horror no is to see how many extended scenes of graphic torture can fit into 2hrs and just under an 'R' rating. And then some idiot on the Internet gets to write about how the destruction of innocent girls represents the death of God and of innocence and so on and so forth...

Maybe torture porn should become a recognized and clearly-labelled genre like XXX (TTT?) so stuff like this would not have to share the same space with The Exorcist and Poltergeist and The Ring. Directors could celebrate nihilism and depravity all they want without having to carry the bourgeois burden of plot, character development, etc. All that would be required would be a simple 5-minute setup scene - an analogue to the beginning of movies where a 19-year old girl dressed in short shorts and stripper heels walks in on 5 guys playing pool and tells them her car broke down and she doesn't have any money for a mechanic or taxi.

In films like Evil Dead or Alien the violence and fear and gore provided a visceral experience, but one whichwas always embedded in something larger - a fantasy about some unknown thing in the dark that we all have this primeval dread of, like the supernatural or alien species. The ordeal the characters went through always had a rationalization you could accept as necessary to the fantasy. Films like A Nightmare on Elm Street and Friday the 13th and Halloween have always been about nothing more but entertainment - the kind of stuff you go see when you're 19 and with 10 people and you immediately forget as soon as you leave the car park. Nobody tries to sell House of Wax or Final Destination or I Know What You Did Last Summer as anything but 2 hours of teenagers getting killed in ways which were similarly gruesome and comical. But to me Martyrs is less horror film than parody. It's just a vehicle for sadism and depravity; that's all I can say about it. There's no difference between and it and any movie starring Lisa-Ann as Sarah Palin or Sasha Grey as a doctor.
Better than Martyrs
At least movies like the above don't insult your intelligence and pretend they're anything more than pandering to people's desire for visceral excitement. People who enjoy watching  torture and abuse will like Martyrs and praise it just as they did Cannibal Holocaust and every Italian and French exploitation film they come across. But here's a question to anybody who sees any artistic merit in Martyrs: why did the writer choose young women to be 'the most sensitive' to the supposed 'transformation'? Why couldn't it have been old men who were chosen to be 'martyrs'? The answer is that nobody wants to see old men in their underwear tortured, abused, and degraded. I guess that's not artistic enough.

Sure Martyrs is disturbing. But if I wanted to be disturbed all I have to do is get on the net and pull up pictures and news about the Somali famine or the DRC or Sierra Leone or Liberian civil wars. There's enough real-life suffering and depravity in this world to last 1000 life times. I really don't need films like this to supposedly tell me how screwed up life is

Thursday, September 29, 2011

Jamey Rodemeyer

Watching this kid you can tell that he never tried to hurt a soul in his life. It's so ridiculous the answers he got on the survey he did - "Gay marriage shouldn't be allowed because it's wrong and disgusting and goes against the Bible." Right but psychologically abusing a 14-year old boy to the point where he commits suicide is A-OK.  But that is the wisdom of the foolish - it's just this way in Trinidad and Uganda and Nigeria and other 3rd-world countries. People will condone and participate in the most immoral and unethical and evil things but God help you if you are LGBT. Jamey Rodemeyer may only have been 14 but he had more courage and strength than most people I know.

It's not really surprising, actually, what happened to him and then after his death. When I was younger I used to believe that stupidity and hypocrisy and evil somehow arose in people's hearts after they became adults. Like that part of humanity that had its logical termination in Nanking and Dachau and Stalin's Gulag and Pol Pot's Cambodia, somehow is absent when we are children. But obviously this isn't the cause. People like Charles Taylor and Bosco Ntaganda and Robert Mugabe didn't just decide one day to act as they did. A lot of people, maybe the majority of people are born evil. It's just their Purpose I guess  - to appropriate a line from The Matrix. The only way that humans can move forward is to understand the way not to live - to cull people like those who bullied and tormented Jamey from our race. At least with technology we can now put a face on some of the nameless victims, whether from New York or Liberia or Sierra Leone or Rwanda.

I really don't know why things like this are allowed to happen, or even if a question like that makes sense. I don't know if his parents and friends should look above for a hand that could have intervened and stopped something like this. Death is part of life - only reason I'm here is that billions of people died before me. A lot of those people were like Jamey - innocent victims of evil people. But I mean from Death comes Life: stronger, smarter, more creative, more compassionate, more giving, more beautiful. Jamey Rodemeyer is dead but the innocence and courage he had inside of him will live on. I think everyone who listens to his Youtube channel videos or reads his blog and understands what he went through, will carry a piece of him wherever they go in life.

Wednesday, September 07, 2011

Under the vine


So Jonah gets pissed off at the world, forsakes mankind, retires to a hill above Nineveh to ponder and reflect while awaiting the fireworks which he had been promised, and which, suffice to say, he had been considerably inconvenienced for. And a gourd vine grows over the sulking Jonah and gives him shelter from the sun for which he is quite happy about, but curses when it dries up and dies. And then God shows up and goes LOL Y U MAD THO?

This day my major concerns were:
  • Taking care of my dog who had surgery on her ear yesterday and convincing her to wear an e-collar.
  • Worrying about finishing work for this open-source project I'm horrendously late with.
  • Debating whether backbone.js and/or JavaScriptMVC is worth learning and using over plain old JavaScript.
This day the biggest issue for tens of millions of men women and children in Africa, and hundreds of millions all over the world, was whether or not they're going to get a drop of water or a bit of food, and whether or not they're going to be alive tomorrow.

So I've been pondering how many gourd vines have been sheltering me. I am so accustomed to thinking that everything I have is somehow the result of my own efforts, but the reality is far from that.


It's the kind of circular existential question which is strictly illogical and makes no sense, but still plagues us: What if I had been born somewhere else? What if instead of sitting here in my yard feeling the breeze, watching the sunset and writing a blog post,  I was trudging dozens of miles in the desert with my emaciated children to get to a horrendously overcrowded relief camp on the off-chance I might get some grain or water, which would postpone starving to death another day.

I didn't build this house - my grandparents and aunt did. The only reason I'm sitting here is because they worked all their life to provide for their family. The only reason I can read or write or use a computer is because they sent me to school. Having the chronic pain of depression and dissociation and social phobia is pretty terrible and leaves me wrenched and exhausted at the end of each day, but still why do I have the use of my two hands or two eyes or two legs or anything that works properly on my body, when so many people in this world don't? At least I have the ability to work towards getting better - while so many with chronic, debilitating illnesses have nothing. My life is a long way from perfect or even happy but why do I even have the things that I have when so many people don't? My family doesn't have a lot but still, why are our cupboards and fridge always filled? As much as evil has touched my life, why have I been spared the kind of horrors I see on the news every night - violence, destruction, death? Luck, chance, fate, karma, what is it? It's nothing I did, that's for sure. It's sort of frightening how little I have actually contributed to my own existence. The truth is that, like Jonah, I haven't had anything to do with the vines that have grown up to shelter my life.

It's like the older I get the list of things that are really important shrinks,  while the list of things that aren't important grows and stretches by orders of magnitudes. But the list of things that I realize are in my control also shrinks, while the list of things that are really outside my control also grows. Not coincidentally, each list aligns with the other.

There's so many people who go to such extraordinary lengths to acquire the things that are not important. The ignorant ones bow down to their idols: money, cars, clothes, parties, sex, approval, popularity, recognition. The evil ones lie, cheat, steal, injure, slander...every abomination and inequity their conceit can fashion, to acquire what their stupid small minds lust after. They both stack these things up like some massive altar and gaze on them, as if it can compensate for how stupid and empty they are inside. Everyday on these call-in programs on TV you hear people lamenting on how bad things are in this country. And I feel like if we could question the politicians and magistrates and lawyers and doctors and engineers and business owners and everyone in this country who have been given responsibility for other people's well-being, and force them to answer truthfully what they consider important, we might see the reason why things in this country are the way they are.

I've always wondered what it is people see in these meaningless things. It's just like Wallace said in the quote in the last post: when you've drunk your fill of these things what are you going to do? I can't understand how people can be so uncaring and selfish and ignorant. If you think life is only about having the most money and driving the best cars and having the most people comment on your Facebook profile, then do you realize what little control you actually have over what you acquire in this life? And when you lose them, which for most people is inevitable, then what are you going to cherish and hold on to? What about the people like in the picture above? Do people realize how close they are to being in a state like that: how easily fate could have given them that burden to carry? Do the billions of impoverished and disadvantaged people in this world really mean anything to anybody?

But I suppose that while most things in life change, a few things don't. The sun and moon and stars and planets change. The earth itself changes - the day that comes tomorrow is never the same as the one before. Knowledge changes, science changes, technology changes. But people don't change. I guess that's one of the main reasons I picked up reading the Bible - the recognition that the stuff that goes on today is exactly the same as the stuff that's been going on for thousands of years.

The truth is that as much as I want the same things other people want, I'd rather work for $20 an hour and go home to a one-room hut by myself and read all night, than to covet what most people in this country covet, and to act as they act. Because what is in my heart is the only thing in this world I can control. Whatever life brings or takes away I have to accept. I can't even control my own health or emotions or thoughts. But the one thing I can control is whether or not I do evil towards anybody else. And as much as so many things weigh on me, just like they weigh on everybody else, the thing that is most important to me is that I try to keep a clean heart. Covetousness, selfishness, deception, hypocrisy, ignorance, and all the myriad ways of evil people - whatever vines grow over me or fall down and dry up, the only thing that I can really control is how far I distance myself from these things.

I always remember back in July 1990 A.N.R. Robinson declaring "Attack with full force!" fully knowing the thing he heard next most likely would have been the gunshot that killed him. It was like the first time in my life I had ever really seen a politician in this country who believed in something beyond their own existence. It was like for one minute somebody put something greater before themselves. Patrick Manning and Basdeo Panday, two of our greatest sons of the soil, had managed to find themselves elsewhere on that day, when their country needed them the most. I have a hard time seeing them do something like that. It's not really hard to see what they really believed in inside - what they thought was important.

 If somebody asks me to help them and it's within my power to do it then I usually do it. I've had so many people including my supposedly close friends take advantage of me for this, but it's cool. Because I believe it is what we were asked to do. And the truth is that I actually am an extremely selfish person. Whatever other people want or take from me they can have it - if it wasn't worthless I wouldn't give it. But see I'm not doing it for them. And I know that is something they will never understand. The real reason I do it is because maybe one day when I really need help, somebody or something might help me. Maybe if one day I'm stretched out hungry, emaciated, dying somewhere with the sun beating down on me, a vine might grow over and shelter me.