Bug Report OpenCL Errors

vaesauce

Member
While we already know this isn't really an OBS issue and some people are getting the Map Error thingy.

I'm curious how many of these users are Radeon owners? It almost feels like all errors that I've seen people post are Radeon users and not Nvidia?
 

Kharay

Member
Actually, from what I've seen, it's the exact opposite. At the very least, I have seen a fair number of nVidia's come by here on the forums that show this particular error. And on my own AMD/ATI I've not seen this error once. Not in the first version of OBS that sported OpenCL nor in any version since.

I am honestly kind of in the dark as to the exact cause for this particular error. I have managed to help a few people to remedy it but not all. It's a peculiar error.
 

vaesauce

Member
Hmmmm, odd.

When i run OpenCL it crashes on me about 10 minutes into the stream and I've always thought that maybe it could be because of my Overclocked settings and I've even tried stock settings and it was no dice. Still can't wrap my head around the issue and I know it's more of a problem with x264 so not much a person can do.

I suppose I'll try to look more into it but until then, I'm pretty much in the dark also lol.
 

Kharay

Member
Which version of Catalyst are you running and are you running Application Profiles? if so, which version?
 

vaesauce

Member
Not running any Application Profiles and I'm running the latest Catalyst that supports OpenGL 4.3 (waiting for the full WHQL in 2 days). I've tried different versions of drivers also after driver sweeps and still a no go xD
 

Kharay

Member
I'm running 13.6 and 13.5 CAP1 and never have any issues with OBS, really. In fact, I've not even seen it crash hard enough to generate a crash report/dump file.

Edit: In fact, the first version of OBS that supported OpenCL ran perfectly fine for me for 11 hours straight. Not a single glitch, not a single D/C, nothing. Even Twitch behaved perfectly throughout those 11 hours.

Anyhow, that's so odd... it should work for you. Give it a try:So, specifically my combination.
 

vaesauce

Member
Nah, i was using that Driver/CAP for awhile and it was no dice.

HOWEVER, I'm using OpenCL right now and testing it and it's not crashing so far. It'll need more testing but the one thing i've done differently is turn off my iGPU since the iGPU (HD4000) has it's own OpenCL, i figured maybe it was interfering with my 7970ghz.

I highly doubt it but if it works, then maybe that is a beginning to the solution lol.
 

z0rz

Member
Not to hijack, but I was having huge issues with only 13.6 before and just installed 13.5 CAP1 and can use OpenCL now. I'm getting some artifacting at relatively normal temps but that can probably be ironed out.

(Sapphire 7870 for the record)
 

vaesauce

Member
Chyeaaahh my OpenCL eventually took another poop on me lol. I've got a fairly powerful Rig so with or without opencl won't big too big of an issue on me. Just didn't want to put too much stress on my CPU.

On a side note though, artifacting? Is your 7870 overclocked? What's your Memory clock at?
 

z0rz

Member
Factory overclock, 1050 core 1250 memory. I tried OpenCL again and no artifacting for a 90 minute stream without making any changes. No idea haha.

Streaming SC2 4v4 games: GPU load maxed at about 70% (temps in the low 50s), CPU never went above 30% (2600k @ 4.3GHz). Pretty neat stuff. Now I just need to learn more about OpenCL :D

I wish I had more to offer about getting it to work. 13.5 CAP1 was apparently all I needed but OpenCL seems pretty fidgety and unpredictable. Hopefully it gets more attention from the x264 devs soon!
 
In my experience, far, far too many games these days are relying on compute shaders on PC. Most if not all of these are done via OpenCL, and as a result the basic OpenCL features of x264 get put on the backburner. Some games will kill or skip my stream, and a few like Just Cause 2 (with water and bokeh processing enabled) can drop it to about eight seconds a frame. It's a matter of competing for resources, and the priority of the x264 OpenCL features seems to be set rather low.

To be honest, if you research what OpenCL is used for in x264 you'd realize the ultimate solution is just to switch it off. The primary function is extensive 'lookahead', but real-time footage like gameplay only buffers about half a second of frames at most so it's useless. We're talking speeding up finding the motion across an entire movie scene in 1080p, not twitching the camera in a first-person shooter. It's a feature designed to aid in pre-recorded footage and likely the only thing it does for you while gaming is cause conflicts rather than help anything.

I know it's not the answer anyone wants to hear, but encoder OpenCL support just isn't intended for gamers. It just happens to be a standard part of the greater x264 package. :/
 

vaesauce

Member
Just from experience, OpenCL, when it works and while streaming. It'll take a lot of load off of my CPU which is why I like it since I'm running a lot of custom settings myself, it pushes the CPU harder than an original preset would. Which opens the door to having better quality in general being streamed.

In general though, having it on makes my games run a lot smoother and faster and the stream is perfectly fine too. I think that's probably why I'm a nut for OpenCL lol.
 

Kharay

Member
carbonFibreOptik said:
I know it's not the answer anyone wants to hear, but encoder OpenCL support just isn't intended for gamers. It just happens to be a standard part of the greater x264 package. :/
What you fail to realize is that not every gamer out there plays a title that:
  • Runs on a shoddy engine
  • Requires ridiculous hardware to begin with
  • Is poorly optimized
  • Has little or no options to reduce its strain on the CPU and GPU
Take your pick, I don't play the game you mentioned but I'm sure one or more of those do apply to it. You see, the thing is -- whereas you ran into a less than brilliant experience in one particular title, others of us have run into nothing but amazing experiences while running OpenCL.

I have also run into a less than brilliant experience in one case; Guild Wars 2, but, you know... after careful study and spending hours upon hours trying to arrive at a configuration that did work, there was only one possible conclusion -- Guild Wars 2 falls into several of the categories i mentioned just now. And it's not even all that popular or all that good. So... I shrug at not being able to stream it.

True enough, OpenCL in x264 does not do nearly as much as it potentially could but both OBS and x264 are still very much in active development, with both projects seeing daily commits. So, I think it is somewhat premature to completely rule OpenCL out as a viable option for videogame streamers.
 
Ah, I don't mean to say that OpenCL support is a bad thing. In my opinion it just isn't entirely worth it to leave it on by default. More games than less have appeared to have issues handing over compute shader cores to another application, especially one that handles such large volumes of data as a video encoder. Then again, some games aren't shader-coreIntensive and will run just fine in tandem with the x264 feature. Personally I run the preset simply because I use a dual-card setup and it allows the encoder to pick frames from each card in the right order, and not grab too many (31 frames on each card happens a lot otherwise and introduces tearing). However that only seems to be an exception to the rule, and uses the OpenCL features for an entirely different purpose than they were implemented for to start.

Just Cause 2 isn't a poorly-made game, by the way. It was just one of the first around when custom compute shaders were possible and so it added effects that DX10 didn't allow at the time. When you see certain things like water simulation and advanced depth of field in modern games, it's directly attributed to Just Cause 2 having proven they were wanted in the next iteration of Microsoft's rendering platform. If you shut off those features the game runs blisteringly fast, but with them enabled it steals cores from the graphics card that could have been used for general rendering or filtering and as such it'll run slow. Really, that's the same case with x264 though in a non-linear association I guess.

Guild Wars 2 is using compute shaders to render the UI and perform entity LOD scaling in ways they deemed necessary to make the MMO work better. The UI is mainly doing it for layering and transparency sorting, and the LOD is so that you can have 200 players loaded in a town rather than have them pop in and out at a distance. Again, both have been issues in all games recently and DX12 really should adopt an official solution that hardware manufacturers can optimize towards.

Oh, and I love GW2 a ton, haha.

Anyway, the old way this used to be performed (and like MAD on the PS2 I should add), was by software emulating the new features and then injecting them into the video card's output buffers. It was very much a hack, and it required LOADS of CPU power in many cases. OpenCL gives developers the chance to offload general computing onto the graphics card of a system, and in many cases large loads consisting of small packets of work can be done much more efficiently and quickly on the graphics card anyway. Now that streaming is popular I'd expect the next batch of cards (some say the 700 series nVidia cards actually have this already) will feature h.264 encoder chips that can be accessed by DirectX applications in general. OpenCL wouldn't be needed then as there would be a way to truly run the encoding workload on a card rather than writing your own machine code in CL. We'll see how that goes in the coming years I guess.

So is OpenCL the greatest thing since sliced bread? Nope. Is it nice to offload work to a GPU supposing you have the spare cycles, latency, and vRAM? Yeah. My advice if you don'e have the power to spare? Pass until a proper solution is in place, or selectively enable OpenCL computing in x264 depending on the game as I do. I only use it for frame sorting and buffering to mend the issues of an SLi setup in any case.

Does my advice mean anything to someone who disagrees? Hell no. It's your computer, so do what you like with it. I'm just sharing my experiences and knowledge so you can make an informed choice on the matter. Besides, it's only used to lookahead and prepare motion vectors, so for the bulk of guys running diagonal or hexagonal vector generation schemes there's almost nothing improved due to the small amount of frames gathered from real-time sources.

Now it you're using another motion vector scheme I could see the benefit, and in fact I don't think anything higher can provide proper quality real-time on a modern CPU anyway (they perform multiple passes). Otherwise the vectors are determined prematurely and are usually incorrect, creating 'meh' P and horrible B frames for a handful of upcoming frames. I've only been able to correct the problem by cutting framerate (more computing time per frame) or raising bandwidth so the compression is lighter while on a CPU, but have had good results with OpenCL when I could use it (stealing motion vectors pre-made from the display buffer on-card).

Really, it's situational to me. That's why I can't recommend OpenCL for live encoders, because for me a straight 'yes' requires having it disabled to be the exception to the rule, not the other way around. Either more uses for OpenCL need to be programmed into the software to justify having it enabled, or the graphics hardware needs to make it standardized so there's no reason at all to disable it. Take my advice with a grain of salt if you're more lenient than I am with these things. Also I'm a technical director for the film industry so again, grain of salt and all since I likely see more errors in encoded video than most people would typically discern.

In any case, OBS and x264 do allow you to use those features when they didn't need to at all, so kudos to the development teams for the options even if I don't always use them.
 

Kharay

Member
carbonFibreOptik said:
Guild Wars 2 is using compute shaders to render the UI and perform entity LOD scaling in ways they deemed necessary to make the MMO work better. The UI is mainly doing it for layering and transparency sorting, and the LOD is so that you can have 200 players loaded in a town rather than have them pop in and out at a distance. Again, both have been issues in all games recently and DX12 really should adopt an official solution that hardware manufacturers can optimize towards.
I know better looking games that perform far better on older hardware that mine. My point is -- no matter the technology behind it, the approach the developers took... the game's engine is shoddy, performs far less well than it could and waste just a waste of the 20-something Gb, as far as I'm concerned. Because not only is the performance of the game poor, there simply is no game to the game. And this is a 12,500+ hour MMORPG veteran speaking. ;) Been gaming since the mid 1980s, gaming is what I do.

Anyhow... I do take it with a grain of salt, or a couple of pinches. Which you shouldn't take the wrong way, I'm just obnoxious, stubborn and enjoying the additional performance OpenCL provides to my aging hardware.
 
Oh by all means don't hold back on my case. I'm stubborn in my own ways as well. As long as things don't drop to troll levels I'm always up for an intellectual quarrel, hehe. Besides, good to see another golden-age gamer in the mix.

That said though, the main issue with GW2 in terms of the engine seems to be texture handling, as the minimum texture size in the game is 1024x1024. Games like WoW, Rift, and ToR all UV-segment meshes to use many, smaller textures rather than throw around large ones like a small-scale game engine would. When you load a level in Crysis or whatever, the loading bar is all the stuff needed going into memory and if you have enough the game runs great. With an MMO, that's much harder to do because of random player loading and area streaming so they tend to be conservative and use lots of 24x80 textures and stuff (WoW isn't simplistic in look artistically on purpose, it was designed to look amazing and they had to scale back to use smaller textures sadly. THE MORE YOU KNOW!). ArenaNet though made their first game on a modified Unreal Engine 2.1 base and had discrete loading points, so the sequel was effectively made by small-scale designers and that doesn't work out well for your framerate or your hard drive when they go open(ish)-world. The compute shaders are wonderful from a TD perspective as transparency sorting is one of the hardest things to get right in real-time 3D these days. However the game does run like crap when your hard-drive has to yank out five large textures (2kx2k on medium settings, ick) every time a new player walks on screen. That I agree is a development flaw, and rightly one that could be fixed if they cared to hire the whole crew for a re-work. I'm betting the first standalone episode they release will address the issue (simply using compressed DXT for textures might be enough even), but that seems about a year away at least. They're taking things slow over there apparently, focusing on monthly content for now. We'll see.
 
Top