Jump to content

  • Log In with Google      Sign In   
  • Create Account

blueshogun96

Member Since 09 Jun 2005
Offline Last Active Aug 17 2016 06:02 PM

#5290490 The API similarities between D3D12, Vulkan and Metal?

Posted by on 06 May 2016 - 05:30 PM

The reason I'm asking this is because I plan to update my engine to support Direct3D12, Vulkan, Metal and OpenGL 4.5 via GL_NV_command_list only.  Right now, my engine supports Direct3D11 and core OpenGL (ES is broken right now), and since so far these APIs seem to be very different than their predecessors after taking a quick look at the basics so I want to write a new interface to handle it... similar to how Direct3D keeps track of it's interface versions.

 

/* Higher level rendering class */

class IKeRenderDevice;

class IKeGeometryBuffer;

 

/* Lower level rendering class */

class IKeRenderDeviceEx;

class IKeCommandBufferEx;

 

What am I asking?  I'm asking how similar, if not, how different are each API from each other?  What I should probably do first is start working on an API as I write some basic code to get acquainted with each API.  Start with a triangle, then add a texture, etc. and design my render device and command buffer classes as I learn.  But the more I learn, the more I tend to run into some gotchas that make it a bit more of a challenge to write a universal API that the user can choose to your liking.

 

If you're curious about my engine so far, you can take a look here: https://github.com/blueshogun96/KunaiEngine

 

And please, don't tell me that I should use UE4 or Unity instead because it's a "waste of time".  That's not constructive and I get tired of arguing this all the time because for me, the benefits of having a custom engine greatly outweigh paying for a pre-built closed source one.

 

Thanks,

 

Shogun.




#5285097 I am beginning to hate the IT and gaming industry (Part 2)

Posted by on 04 April 2016 - 02:31 PM

Btw, the reason I typed another rant was in hopes that someone could help persuade me to view otherwise.  So far, nobody has done it, in or out of this forum.  Don't worry, I promise this is the last time.

 


Charm wins

I'm not convinced.  There was nothing charming about me when I demonstrated skill that got me a job.

 


Do you ever ask your interviews for feedback or anything like that?

Assuming I'm reading you correctly (sorry, this is a bit ambiguous to me), interviewers give me feedback a day or two after the interview.  Asking for feedback before leaving is something they generally don't do.  So it kinda goes back to the "smile in your face until you leave" thing.

 

 

I do most of the technical hiring where I work, as in interviews.

 

I never liked the concept of whiteboarding because it's time consuming/wasteful/stressful. Instead, I simply break one of our smaller projects a bit, and ask them to build it. I check to make sure they notice the important errors, make sure they look at the class view of the components we're using to see why parameters are wrong, ask them where they'd put a debug write to figure it out. If they demonstrate the ability to make logical decisions (Most of the time it can't be resolved without in-depth knowledge of the app), they usually get a pass for the things they don't know.

 

It's surprising to me that if you out-perform your co-workers, you'll still be let go while working for a company like Microsoft... Have you tried speaking with your project manager about it, and stressing the fact that they often re-hire you wasting resources on more interviews?

 

the IT sector is extremely unfriendly to workers, game dev even more so... But I don't really understand why. Some of our core devs don't even have degrees, but were hired on their obvious skill. And when we have a team that delivers great software, we wouldn't consider cutting anyone just to save money... That money should be re-invested into the company, and the cycle of potentially hiring/firing devs all the time's costly.

I like this way of thinking, very much so.  I find this to be more practical than the typical whiteboard exam.  I found that interviews that involve an actual IDE and real world problems I enjoy even better.  Even though I didn't get the last position that interviewed me this way (not senior level enough), it was much more productive and I even learned a thing or two I could have improved on so that interview even though I failed was actually worth going to.  C#/Java and Selenium Webdriver is definitely a skill that can be mastered fairly easily.  As soon as I can afford to pay for my domain again, I'll spend a few moments automating my website and see if it's feasible for other stuff.

 

And yes, that's just how it is... when you're not a full time employee.  Chances are, they'll never find another guy who's able to write driver level GPU code and performance monitoring tools from scratch so easily either.  If I was full time, then getting rid of me would not be as easy.  And yes, I did talk to my managers about getting full time work.  Letting me go wasn't their decision, otherwise they'd have kept me because I was highly praised for my skills there.

 

Yes, it is quite hostile, hence why I left gaming as a career in 2013 permanently because I was fed up with being seen as a lesser employee and getting yelled at because I didn't do <insert here> to their immediate liking.  Working for non-gaming companies has treated me much better.  That's why I prefer working on the run of the mill software program in an traditional environment.  Better treatment, better pay.

 


Did you try to apply to non-game dev positions, or at least check out your chances to get such a position? Given that you are fed up with the game industry this much, and even a year later feel the same, Maybe the game industry is no longer for you?

Okay, I remember you replied last time, but I wanted to make things a bit clearer just in case you didn't understand me now or prior.  I haven't worked for any gaming related company/position since 2013 when I decided it was enough.  So yes, I have applied and worked at many non-gaming companies and have been quite satisfied with most of those jobs.  Needless to say, I've had much more success and fulfillment with non-game dev.

 


And while you might lack the job expierience now, maybe some short term education, as well as selling yourself well during interviews can help you over that hurdle?

Education won't really change anything.  It's quite rare that I'm asked for any degree credentials or turned down due to lack thereof either.  Also, when I say inexperienced, I mean it in regards to very specific areas.  I have 6+ years experience overall, but let's say you don't have enough experience (or none) using something like angular.js, Google Analytics, Selenium Webdriver, etc., then your previous experience is not likely to count.  Of course, those are things you can improve on yourself in your own time, but many times they expect you to have done it on another job before giving you a chance.

 


blueshogun96, on 04 Apr 2016 - 02:27 AM, said:


1. Whiteboarding

I've been involved in both giving and receiving of interviews many times.



Very few companies have ever asked me to write code on a whiteboard. I've had to solve problems and diagram things on a white board, but that is different from writing code. I don't require people to write code on a whiteboard.



In my job, many times I've needed to diagram problems and work out solutions where the whiteboard is the easiest thing on hand to help collaborate. So that part is realistic.



I agree that "write perfect code on a whiteboard" is an unrealistic assessment. If a company is doing that, they've got a terrible interviewing practice.



The process of "Let me explain and diagram a problem for you to solve", however, IS a realistic assessment because that happens all the time in my experience. That is fine.

 

This I am in full agreement with.  Things like flow charting, etc. is quite reasonable and realistic on a whiteboard.  Faster and more convenient too.  What I do like is when interviewers allow me to chart out my idea before diving into code at least. 


If your complaint is that companies are breaking their contracts with you early, and that it happens frequently, that is not like what I've experienced or witnessed, except for people who are toxic to be around. If the person is not sociable or difficult to work with, they will be gone, either for a contractor getting their contract terminated or a regular employee getting written up, having a "performance improvement plan" or similar document put together, and being fired a month later if the attitude did not completely turn around.

No, it's not a complaint, but a frustration nonetheless.  Contract to hire is also a challenge to find.  When a contract is ending, it's usually because the product has shipped, and they need less people to pay, so they start laying us off.  I just do my work to the best of my ability and go from there.

 


These are all very different entities.



Your assessment is correct that the smaller businesses are sometimes harder to get called back, and harder still to get the job. Sometimes it is easier. The biggest determining factor, in my experience, is how your job history looks. If you look like a job hopper, or like you cannot complete projects, your job history is suspicious.



Startups and small companies are more shy of people with suspicious records. If you've got five or ten years of experience somewhere they love it, you'll likely be an asset. But small companies usually have extremely lean budgets and they don't want to take a risk on a bad employee.



Big companies can usually afford to take more risks when it comes to workers with suspicious work histories.



If your resume is short, or if your jobs appear to be moving from company to company in under two years, whatever the reason, it makes sense that startups and small companies won't hire you. They will dig in and want to know the reason for each early separation. They can understand an early termination if the high-risk project was terminated, sometimes a person is unlucky and gets two such jobs. But more than that and they're unlikely to consider you for the risk.

Makes sense.  My resume is roughly 3 pages long though, and I've never had a permanent position before.

 


Someone who hates the industry (as it seems you do) will tend to have an attitude that is toxic to everyone. Those who work with the individual get frustrated and angry rather than taking pride in their accomplishments. People who do not enjoy their jobs tend to arrive late and leave early, tend to do shoddy work, tend to be bad employees.

Hence why I don't work in gaming anymore.  When working in non-gamedev positions, I'm much happier and productive.  But then the sudden lay off comes without any warning, and then I'm going through the frequent grind of the interview process (assuming I'm even getting that far).  As much as I've grown to detest working at gaming companies, I've never had any problem against the work from non-gaming companies.  It's just the hostile interviewing and layoff process that I'm getting tired of and what I am growing to hate.  When I started back at Microsoft, I was like "yeeeehaw!  Let's get this show on the road!".  So I hauled ass, not sagged ass.  I kicked ass, and not kissed ass.

 


Someone who hates the industry (as it seems you do) will tend to have an attitude that is toxic to everyone. Those who work with the individual get frustrated and angry rather than taking pride in their accomplishments. People who do not enjoy their jobs tend to arrive late and leave early, tend to do shoddy work, tend to be bad employees.

Read it again.

 


I've also never been asked to do whiteboard coding.

I wish I could find a company like this.

 


I suppose you've ruled out the notion that employers are using absurdly high standards of whiteboard coding and experience to weed you out for reasons unrelated to your actual technical competence? I wouldn't be terribly surprised at some employers having a "favored candidate" and going out of their way to make things tough for people who aren't that candidate - or don't "look" like their ideal candidate, either in terms of personality/temperament, experience level, or even (sadly) things like race or gender.

Eh, who knows?  I've heard stories about it.

 

Btw, who said anything about giving up?

 

Shogun.




#5284994 I am beginning to hate the IT and gaming industry (Part 2)

Posted by on 04 April 2016 - 03:27 AM

A little over a year later, I feel a need to do a sequel to my previous thread: http://www.gamedev.net/topic/664743-i-am-beginning-to-hate-the-it-and-gaming-industry/

 

Now, going back to some of the advice from that thread, and looking at my current experience and perspective, I can honestly say that my views towards the industry haven't changed much, even though I've worked on two great positions since then.  To be quite honest, I still hate how this industry works and it's really burning me out.  Some things cannot be helped, others are just bogus and obsolete traditions that employers cannot seem to do a way with.  This isn't a "tantrum" because I couldn't get job at company XYZ, but more of a continuation of my previous venting about my frustration involving a vicious cycle of [finding/keeping] employment and security.

 

Rather than ranting away, I'll share a list of points like I did last year.

 

1. Whiteboarding

 

The one thing I absolutely hate the most about interviewing, and that is whiteboarding.  Let me get this one out of the way first.  Let's face it, whiteboarding sucks, it's mundane, and it cannot accurately attest to a candidate's actual ability to perform the given task.  Apparently, more and more software devs are agreeing with this.

 

http://programmers.stackexchange.com/questions/188381/engineering-interview-candidate-refuses-to-use-whiteboard

http://www.forbes.com/sites/vivekravisankar/2015/05/04/the-rise-and-looming-fall-of-the-engineering-whiteboard-interview/#2983bfdc471b

http://techcrunch.com/2015/03/21/the-terrible-technical-interview/

 

From Forbes:

 

You give them a coding challenge, like “sort an array of 100 integers.” They have to stand up, turn to a vertical blank slate and handwrite code from scratch while a handful of senior engineers scrutinize their every word and move. Writing code on a whiteboard is a skill in and of itself. How does this awkward experience tell you anything meaningful about how well engineers can truly think and work in their element?

 

From Techcrunch:

 

Few professions seem so openly hostile to their current members as software engineering … we expect people to do live engineering on a white board under stressful interview conditions because, well, because that is what we have always done … In a time of engineer austerity, we simply can’t afford to throw away so much talent.

 

The software developer job interview doesn’t work. Companies should stop relying on them. The savviest teams will outcompete their peers by devising alternative hiring schemes.

 

I believe these sum it up nicely, as it has been my experience also.  Now, I've heard many of you say, "interviewers are more interested in your problem solving skills than how well/accurately you code the actual problem".  I always have and always will call bulls**t on that.  If that's so, then why do I NEVER get the job unless I nail the whiteboard problem on the first try with no error and at full optimization?  I've demonstrated great problem solving skills and have been commended on it multiple times, but still didn't get it because I didn't do the problem perfectly.  So you can tell me this until you are blue in the face and I will never believe it since I've been through many, many, many white board interviews.

 

A whiteboard test does little to attest to someone's skill or experience level.  There's really no point in solving some mundane problem that will never really be used in most cases.  On top of that, the ability or lack thereof to solve that particular problem within a certain amount of time does not attest to one's skills either.  There are many common whiteboard problems out there, most of which can be googled and practiced as well as memorized.  That way, a poor or inexperienced coder could slip under the radar with ease.  Good candidates aren't like parrots; memorize and repeat.  They are built to solve real world problems in practical conditions and environments.

 

One of the last interviews I had, the interviewer told me that he felt (based on the whiteboard) that I would not be able to ramp up quickly enough and that I would likely be replaced during this 4 month contract time period.  That is complete and utter nonsense.  How the hell can you tell this by someone's whiteboarding exam problem that has NOTHING to do with the task you're actually being interviewed for?  See how retarded this process is?

 

Fortunately, my last position at Microsoft didn't involve a whiteboard test, and I was very grateful of that.  Because of that, I was able to prove and demonstrate my exceptional skills as an SDET with hardware and driver level programming skill and leave a lasting impression on my superiors and co-workers.  Some of that stuff I wrote would be solutions that most experienced coders would not have come up with because I had both the affinity and the aptitude for the task at hand.  If they had gone through the usual BS whiteboard exam, not only would I not have gotten the job, but much of the work going into one of their latest devices would likely have never been done.

 

So frankly, I've taken much of the advice on whiteboarding in my previous thread, and it never really helped.  Only a perfect whiteboard answer would get me the job, nothing else.  Bottom line: whiteboarding.... it just, doesn't, work.  There's not much more that I hate about interviews with a hiring manager who has already determined that you don't have a chance in hell at getting this job because of the whiteboard test, but still smiles in your face and talks as if you do.  I mean really, at my last interview, one of the interviewers wrote something on a piece of paper and showed it to another person next to him right in front of me.  Wtf?  How stupid do you think I am?

 

Bonus fact: The last two jobs I had didn't require me to take a whiteboard test, which I believe is the primary reason why I got those jobs.  There was one more I could have had, but I was told I was overqualified since I talked about my coding skills/experience.

 

2. Contract vs. Permanent

 

This can't always be helped, and it's a part of life, I understand that.  But in my experience (and in others, I'm quite sure), more and more companies are either outsourcing their projects to recruiters or just simply hiring temporarily for a single project.  It makes sense in many ways, but at the same time, when it comes to contract work, you can never really expect it to last the full duration you are quoted.  For me, it never does.  Never.  If I'm quoted a year, I'd expect to be employed for half of that roughly.  This is especially true during release time, then they start looking at ways to cut budgets and starting dishing out layoffs.  It's so predictable, and tiring not being able to settle down at one place.  Of course, one good thing about this is that with every new job I get, my salary increases and my worth as an employee is easier to self quantify.  But knowing that you are about to get the boot as well as knowing that you are expendable at any sudden moment can really put pressure on you to perform or even outperform co-workers.  The animosity created by competition is real, and I've seen it more than once, even at Microsoft.  The last thing I want is to be pitted against my co-workers for the sake of keeping a job and/or becoming permanent.

 

"If you are tired of contracting, why not apply for full time?".  Do you think I haven't been trying that??  The consideration, availability and sheer competition for full time employment is astronomically stacked against you.  I've been searching my arse off for it.  So far, I've only had one interview for full time, and let's just say it was whiteboard related as to why I didn't get it.  Employers are getting tighter and tighter, and are looking for clever ways to save a buck, even if it means trying to find senior level people and trying to avoid paying them what they are worth.

 

3. Startups & Small Companies vs. Big Corporations

 

Now, I get a ridiculous amount of the same suggestion on this.  And that suggestion is, "why don't you try a startup or a smaller company instead"?  Once again, do you think I haven't been trying those??  The truth is, I've had a MUCH harder time with applying for startups and smaller businesses than the large "gargantuan" companies as someone put it before.  Startups generally don't give me the light of day.  Believe me, I've tried many times.  The larger the company, the more success I tend to have.  If there's one thing I like about Microsoft, is that they usually give me a fair trial inspite of them being one of the lower paying companies.  And if I had to choose, I'd likely choose a gargantuan company because I don't like the "social friendly beer friday" types of company atmospheres.  I want to come to work, get my stuff done, work hard, build myself up, and maybe an occasional goof day.  None of that extra stuff.  If you want to party and drink, don't do it around me and look for an excuse to dig up dirt on me with HR; why not do it on your own time?  Leave me alone and let me work.  So yeah, the work hard feel of the big corporate environment is what I like.

 

4. All About the Experience

 

Some of this I already ranted before, but I'll do it again.  Yup, no experience == no job.  End of story.  I keep hearing stuff like putting your own projects or things like game jams or coding competitions on your resume.  That stuff never really seems to work for me.  Maybe it does and I just don't know it, but employers never talk about it; rarely if ever.  I've even had one employer say that I had no experience based on personal projects.  On top of that, it tends to confuse employers and recruiters.  So, I generally don't bother.

 

So unless I've done <insert here> and got paid for it by someone else, I'm not experienced?  Yeah, F you.  If I had mountains of experience as they always seem to search for, I wouldn't be looking for a job, would I?  Because I'd have companies throwing themselves at me like blonde gold diggers throwing themselves a millionaires. 

 

I do understand that experience is important, especially in this field.  The more experience I gain, the more I understand the difference between an experienced professional developer and the high school or undergrad who's only taken a few courses and done a few side projects.  Speaking of inexperienced, what's with entry level positions having such strict experience requirements? 

 

5. Enthusiam Makes Up for Inexperience

 

Riiiiiight, sure it does.  Another thing you'll never convince me of.  Seriously, if that were the case, then I'd have had much more success.  If I had a dollar for all the enthusiasm I've shown to make up for inexperience, I'd have enough to pay my rent (and I don't right now, and it SUCKS)!  You can have all the enthusiasm in the world and they still won't give you the light of day.  Only one exception I've had was a company (that some of you might be surprised to know still exists) that wanted to give me a chance due to my enthusiasm.  What happened?  Still didn't get the job because of "not enough experience".  This goes for big and small companies, and startups have been the most picky about it so far.

 

6. "Overqualified"

 

This is one thing I never touched on in the last rant.  What the hell is "overqualified"?  Don't you want someone that can go above and beyond for your company?  Or do you fear the candidate would get "bored"?  These days, a job is nothing to be taken for granted.  One member here says that basically means "you are a threat".  I guess I could see that, but really, with companies not willing to pay someone a competent salary, what the actual frell?  Normally when you hear the words "overqualified", it's hard to get out of that zone.  So far, I've gotten out of the overqualified zone only once.  Still didn't get the job though.

 

 

So that's my rant for this year.  Not nearly as long, but sharing my experience based on the responses on the previous thread as well as the results from trying out those suggestions.  My general opinion hasn't changed from last time either.  And just to reiterate this once more, I do not want to work for a gaming company, ever again.  Just so we're clear on that because I like being treated and paid like an adult.

 

I've even thought of saying something like this at an interview before: "How about I refuse your whiteboard test?  Why?  Because it's an out dated, mundane and ineffective way to judge someone's skill or experience level.  Do you seriously expect to accurately measure someone's talent or problem solving skills by putting them on the spotlight where everything you write or say can be used against you?  Better yet, how can you be sure this isn't a problem I've memorized through the internet?  I've proven that with my previous and extensive experience that I already know how to code effectively, even through a nice list of references.  Now, unless you have a more practical way of evaluating my skill set, I will walk.  What do I suggest?  I dunno, you tell me.  Show me the door."

 

Needless to say, I see a growing number of devs getting tired of this cycle.  And now I want to break it.

 

Shogun.




#5284972 How beneficial can personal projects be?

Posted by on 04 April 2016 - 12:33 AM

Companies generally won't care unless those personal project games are big and/or profitable.  They will overlook it if you do not have experience.

 

Source: 6+ years in the game/software engineering field.  YMMV of course.

 

Shogun.




#5281825 Does my game only work when installed using ADB?

Posted by on 18 March 2016 - 03:28 AM

I recently managed to re-port my game to Android and for me it works without any issues, but everyone else I've given my game to says they just get a white screen.  This isn't making any sense to me.  The difference is that everyone else is downloading it directly from the link below and running it from there while I and one other person installed it through ADB and it works normally.  Why is that?  Does that mean there's something wrong with my code somewhere?

 

For those that want to try it, you can click the link and downloaded here: *nuked; I'll release a more functional build later*

 

This should work on any device running API 10 or greater, and the target sdk version is 16 to keep it compatible with most devices.  Lastly, I don't know if this would have made any difference, but I used Eclipse instead of Android Studio because I never did find any resources on the recent NDK support, and Eclipse just worked unlike everything else for me.  If it does run, then keep in mind that it won't be scaled properly in "Story Mode" because I didn't fix that yet (no need to point that out).  But if you could try it, that would be greatly appreciated.

 

I ran this on my Nexus 7 (2nd Gen, 5.1) and my Droid1 (4.1.1).  Both ran for me, but of course the latter device can't really handle this game too well due to it's age, small screen resolution and low quality touch screen.  I've gotten the white screen on the Droid1 before, but I'd wait it out and the game would work for me after a minute or two.

 

So one thing I did was remove the white screen by adding  this to my style.xml

<item name="android:windowNoTitle">true</item>

When I get a chance, I'll do a splash screen...

 

Any ideas?  Thanks.

 

Shogun

 

EDIT: Just tried downloading it from the net directly on my Nexus 7, it didn't work; just the white screen.  But installing using adb does work...

 

EDIT2: Nevermind, I fixed it.  I forgot to comment out one particular line (Debug.waitForDebugger() to be specific) that causes the device to wait for the debugger to attach itself.  I thought for sure that I did...




#5278452 SDL: How do I get a native handle to the OpenGL context

Posted by on 27 February 2016 - 11:24 AM

Yes, I just figured that out last night.  After looking through SDL's source code, it was quite blatant that for OSX, it just essentially casted it to void*.

 

Either way, I didn't realize that I could simply get the current context by calling this:

NSOpenGLContext* context = [NSOpenGLContext currentContext];

Live and learn.

 

Shogun.




#5254064 GPU load/temp monitoring for Intel?

Posted by on 25 September 2015 - 05:38 PM

Okay, I wrote some basic code for the NV driver.  Turns out that NVAPI doesn't directly expose the API needed to get your GPU load percentage.  So I had to implement a workaround based on this guy's blog example: http://eliang.blogspot.com/2011/05/getting-nvidia-gpu-usage-in-c.html

 

It's not the safest way, but it does work for both 32 and 64 bit, and 64-bit is our target.

 

The code I wrote based off of this (sharing for future programmers who may need this years down the line).

#ifndef NV_H
#define NV_H

#include <Windows.h>
#include <iostream>
//#include <nvapi.h>


/*
 * Name: NvGpuDetected
 * Desc: Returns true if an NVIDIA Gpu has been detected on this system.
 * NOTE: This function depends on whether a valid NVIDIA driver is installed
 *       on the target machine.  Since the Surface Hub does not include an
 *		 nvapi[64].dll in it's strippified driver, we need to load it directly 
 *		 in order for the required APIs to work.
 */
BOOL NvGpuDetected();

/*
 * Name: NvGetGpuLoad
 * Desc: Returns the NVIDIA Gpu's current load percentage.
 */
int  NvGetGpuLoad();

/*
 * Name: NvGetGpuTemperature
 * Desc: Returns the current temperature of an NVIDIA Gpu.
 */
int  NvGetGpuTemperature();

#endif // NV_H


#include "nvidia.h"

#if defined(_M_X64) || defined(__amd64__)
#define NVAPI_DLL "nvapi64.dll"
#else
#define NVAPI_DLL "nvapi.dll"
#endif


// magic numbers, do not change them
#define NVAPI_MAX_PHYSICAL_GPUS   64
#define NVAPI_MAX_USAGES_PER_GPU  34
     
// function pointer types
typedef int *(*NvAPI_QueryInterface_t)(unsigned int offset);
typedef int (*NvAPI_Initialize_t)();
typedef int (*NvAPI_EnumPhysicalGPUs_t)(int **handles, int *count);
typedef int (*NvAPI_GPU_GetUsages_t)(int *handle, unsigned int *usages);

// nvapi.dll internal function pointers
NvAPI_QueryInterface_t      NvAPI_QueryInterface     = NULL;
NvAPI_Initialize_t          NvAPI_Initialize         = NULL;
NvAPI_EnumPhysicalGPUs_t    NvAPI_EnumPhysicalGPUs   = NULL;
NvAPI_GPU_GetUsages_t       NvAPI_GPU_GetUsages      = NULL;



/*
 * Name: NvGpuDetected
 * Desc: Returns true if an NVIDIA Gpu has been detected on this system.
 * NOTE: This function depends on whether a valid NVIDIA driver is installed
 *       on the target machine.  Since the Surface Hub does not include an
 *		 nvapi[64].dll in it's strippified driver, we need to load it directly 
 *		 in order for the required APIs to work.
 */
BOOL NvGpuDetected()
{
    HMODULE hmod = LoadLibraryA( NVAPI_DLL );

	if( hmod == NULL )
    {
        std::cerr << "Couldn't find " << NVAPI_DLL << std::endl;
        return FALSE;
    }

	// nvapi_QueryInterface is a function used to retrieve other internal functions in nvapi.dll
    NvAPI_QueryInterface = (NvAPI_QueryInterface_t) GetProcAddress( hmod, "nvapi_QueryInterface" );
     
    // some useful internal functions that aren't exported by nvapi.dll
    NvAPI_Initialize = (NvAPI_Initialize_t) (*NvAPI_QueryInterface)(0x0150E828);
    NvAPI_EnumPhysicalGPUs = (NvAPI_EnumPhysicalGPUs_t) (*NvAPI_QueryInterface)(0xE5AC921F);
    NvAPI_GPU_GetUsages = (NvAPI_GPU_GetUsages_t) (*NvAPI_QueryInterface)(0x189A1FDF);
     
    if( NvAPI_Initialize == NULL || NvAPI_EnumPhysicalGPUs == NULL ||
        NvAPI_EnumPhysicalGPUs == NULL || NvAPI_GPU_GetUsages == NULL )
    {
        std::cerr << "Couldn't get functions in nvapi.dll" << std::endl;
        return FALSE;
    }
     
    // initialize NvAPI library, call it once before calling any other NvAPI functions
    if( (*NvAPI_Initialize)() != 0 )
	{
		std::cerr << "Could not initialize nvapi!" << std::endl;
	}

	return TRUE;
}

/*
 * Name: NvGetGpuLoad
 * Desc: Returns the NVIDIA Gpu's current load percentage.
 */
int  NvGetGpuLoad()
{
	int          gpuCount = 0;
    int         *gpuHandles[NVAPI_MAX_PHYSICAL_GPUS] = { NULL };
    unsigned int gpuUsages[NVAPI_MAX_USAGES_PER_GPU] = { 0 };
     
    // gpuUsages[0] must be this value, otherwise NvAPI_GPU_GetUsages won't work
    gpuUsages[0] = (NVAPI_MAX_USAGES_PER_GPU * 4) | 0x10000;
     
    (*NvAPI_EnumPhysicalGPUs)( gpuHandles, &gpuCount );
     
    (*NvAPI_GPU_GetUsages)( gpuHandles[0], gpuUsages );
    int usage = gpuUsages[3];

	return 0;
}

/*
 * Name: NvGetGpuTemperature
 * Desc: Returns the current temperature of an NVIDIA Gpu.
 */
int  NvGetGpuTemperature()
{
	return 0;	// TODO
}


#if 0
int main()
{   
#if defined(_M_X64) || defined(__amd64__)
    HMODULE hmod = LoadLibraryA("nvapi64.dll");
#else
	HMODULE hmod = LoadLibraryA("nvapi.dll");
#endif
    if (hmod == NULL)
    {
        std::cerr << "Couldn't find nvapi.dll" << std::endl;
        return 1;
    }
     
    // nvapi.dll internal function pointers
    NvAPI_QueryInterface_t      NvAPI_QueryInterface     = NULL;
    NvAPI_Initialize_t          NvAPI_Initialize         = NULL;
    NvAPI_EnumPhysicalGPUs_t    NvAPI_EnumPhysicalGPUs   = NULL;
    NvAPI_GPU_GetUsages_t       NvAPI_GPU_GetUsages      = NULL;
     
    // nvapi_QueryInterface is a function used to retrieve other internal functions in nvapi.dll
    NvAPI_QueryInterface = (NvAPI_QueryInterface_t) GetProcAddress(hmod, "nvapi_QueryInterface");
     
    // some useful internal functions that aren't exported by nvapi.dll
    NvAPI_Initialize = (NvAPI_Initialize_t) (*NvAPI_QueryInterface)(0x0150E828);
    NvAPI_EnumPhysicalGPUs = (NvAPI_EnumPhysicalGPUs_t) (*NvAPI_QueryInterface)(0xE5AC921F);
    NvAPI_GPU_GetUsages = (NvAPI_GPU_GetUsages_t) (*NvAPI_QueryInterface)(0x189A1FDF);
     
    if (NvAPI_Initialize == NULL || NvAPI_EnumPhysicalGPUs == NULL ||
        NvAPI_EnumPhysicalGPUs == NULL || NvAPI_GPU_GetUsages == NULL)
    {
        std::cerr << "Couldn't get functions in nvapi.dll" << std::endl;
        return 2;
    }
     
    // initialize NvAPI library, call it once before calling any other NvAPI functions
    (*NvAPI_Initialize)();
     
    int          gpuCount = 0;
    int         *gpuHandles[NVAPI_MAX_PHYSICAL_GPUS] = { NULL };
    unsigned int gpuUsages[NVAPI_MAX_USAGES_PER_GPU] = { 0 };
     
    // gpuUsages[0] must be this value, otherwise NvAPI_GPU_GetUsages won't work
    gpuUsages[0] = (NVAPI_MAX_USAGES_PER_GPU * 4) | 0x10000;
     
    (*NvAPI_EnumPhysicalGPUs)(gpuHandles, &gpuCount);
     
    // print GPU usage every second
    for (int i = 0; i < 100; i++)
    {
        (*NvAPI_GPU_GetUsages)(gpuHandles[0], gpuUsages);
        int usage = gpuUsages[3];
        std::cout << "GPU Usage: " << usage << std::endl;
        Sleep(1000);
    }
     
    return 0;
}
#endif

Working on a D3DKMT version for Intel and everything else.  I'll share that if/when it works.

 

Shogun.




#5253931 GPU load/temp monitoring for Intel?

Posted by on 24 September 2015 - 08:37 PM

Okay, I've been given the task to write a GPU load and temperature monitoring tool as part of an automated test suite for my job.  Since I'm under NDA, I won't get too detailed about my project outside of what is publicly available.  We have two devices, one with an Intel 4600 GPU, and the other is a Quadro K2200.  For the NV stuff, that's easy.  I can use NVAPI to get exactly what I need.  For Intel, I can't seem to find a similar library.  If necessary, I may have to do something on the driver level, hopefully not, but this has got to get done ASAP and we're shipping in Q1 next year.

 

As usual, I tried doing a bit of googling, and wasn't able to find what I needed.  Any ideas?  Thanks.

 

Shogun.




#5240305 SDL 2.0.x game controller events not working.

Posted by on 14 July 2015 - 01:07 PM

Nevermind, it's my own code causing the problem.  The deconstructor in my gamepad handle class gets called after adding it to the vector due to it going out of scope.  I should have used a smart pointer instead to delay that.  Thanks for reading.

Shogun.




#5236177 Read a text file from a .zip container

Posted by on 22 June 2015 - 10:56 AM



If you have garbage at the end of your shader:

 

Are you storing the 0 terminator with the string in the zip file? If not (likely) your buffer to read a text file should be allocated so it has space for one extra '\0' character at the end.

Otherwise basically all methods expecting c strings will read over the end of the string since there is no marker denoting the actual end.

Actually, I tried this before I posted, but it didn't work at first.  That's because what I did was this:

 

vs[size-1] = '\0';

 

I did it that way because I didn't want to go beyond what was allocated.  But when I did this, it worked:

 

vs[size] = 0;

 

Now it works every time.  Thanks.

 

Shogun.




#5236123 Read a text file from a .zip container

Posted by on 22 June 2015 - 02:47 AM

I've got a rather strange issue, one that I've only found one google result on, but no solutions.  My game needs to be able to read a text file from a zip archive.  Reading files such as textures, sound effects, and other binary formats work fine, but a text file can contain some garbage characters it seems like.  To be more specific, I'm trying to read and use my GLSL vertex and fragment programs.  When I use the string I get, it gives me strange errors regarding text that I know for a fact was never placed in the text file.

 

I'm using miniz.c because it's simple and easy to use.  This is basically what it looks like:

bool KeZipResourceArchive::Read( std::string filename, void** ptr, size_t* size )
{
	*ptr = mz_zip_reader_extract_file_to_heap( (mz_zip_archive*) archive, filename.c_str(), size, 0 );
	if( !(*ptr ) )
		return false;
    
	return true;
}

And an example usage:

 

pArchive->Read( "square_vp_es2.txt", (void**) &vs, &size );
pArchive->Read( "square_fp_es2.txt", (void**) &fs, &size );
 
No idea what the problem is.  Any ideas?  Thanks.
 
Shogun.



#5235534 I am beginning to hate the IT and gaming industry.

Posted by on 18 June 2015 - 12:17 PM

Well, whaddayaknow, Mr. Sloper was right today.  One of my interviewers told me I was a bit Junior, but wanted to continue to interview me anyway because of my level of enthusiasm.  The 2nd phone interview is tomorrow morning.  I just wish they'd bring me in already...

 

Shogun.




#5234669 I am beginning to hate the IT and gaming industry.

Posted by on 13 June 2015 - 06:50 PM


I tried checking your website. The overall template is solid, but you have a dead link on your contact page, no resume page, and I still see a lot of boilerplate. I don't know if you've used this site in your job hunt, but it's the kind of thing that can set some interviewers off on the wrong foot (read: the site that you use to promote yourself looks like you don't finish what you started). From my experience, I've had much more luck just saying I took it down because what I had up there was no longer reflective of my skills, and that I haven't had time to update it because I've been working on X. I then use that as a launching pad to talk about X.

My website isn't for attracting potential employers.  You're right, I need to fix that, and a few other things, but I haven't gotten around to it.

 


I saw that you've been in touch with recruiters, that's a good thing. Being in many IT recruiter databases means you'll get contacted more often when some of their clients are looking for work. That being said, many recruiter based jobs are quite boring. I've used those as a launch pad to work my way towards more interesting, meaty work. I hope that in your area you can do likewise.

I haven't been able to successfully find ANY jobs in my city without the help of recruitment agencies.  Looking on the bright side, getting an IT gig is much easier than, lets say, trying to get a job at McDonalds or some other blue collar job that doesn't require special skills.

 


P.S. Even though I "know" the material in this article, I find rereading the following puts me in the right mood for interviewing. It may not work for you, but I recommend finding some ritual that gets you in the right mindset. (yes, salary negotiation is the last step, but it still works for me)

http://www.kalzumeus.com/2012/01/23/salary-negotiation/

Thanks.

 

 

 


Also, to my surprise, it's not easy finding peeps in my area on this website.  Especially those who are professionals who are doing non-gaming IT work.

Wait, what? There are a ton of us on this site who live/work in Seattle.

 

Haven't knowingly met any yet.  Oh yeah, forgot to start that thread.

 

Shogun.




#5234537 I am beginning to hate the IT and gaming industry.

Posted by on 12 June 2015 - 05:55 PM

Then I'll start a thread about it and find out!

 

Shogun.




#5233002 I am beginning to hate the IT and gaming industry.

Posted by on 05 June 2015 - 01:26 PM

 

Didn't notice that this thread was bumped again.  Since it's still open, I'll add that I'm back where I started again.  Time to go though this BS job hunt crap again.  And tbh (I'm not saying this to stir up drama), I S-T-I-L-L not convinced that employers care about skill, but only job experience and your ability to ace the whiteboard on the first try.  That's the ONLY way I ever get IT jobs.  I almost had a job as a deployment engineer for Starbucks, but I got outclassed by one guy.  Soooo close.

 

Going to go back through the thread and re-discover a few suggestions.

 

 

Did you try going with placement agencies and working as a contract to hire first? 

 

That's exactly what I've been doing my entire career.  No one has ever hired me from a contract because most of employers aren't looking to hire.

 

Shogun.






PARTNERS