It's jaqbenny's birthday week!
jaqbenny's avatar

jaqbenny

Toby
6 Watchers55 Deviations
6.4K
Pageviews
this is just going to point to a deviant I just did. it's actually a chunk of code. but I commented the living snot out of it and so now it is a tutorial for writing your first openCL program. it explains the entire process of getting a program on to the device, setting the data and the arguments, running, and retrieving(just in a few more steps). and I would have killed to have it when i was trying to figure this out on my own. but there it is now. happy fun and joy!
jaqbenny.deviantart.com/art/Op…

Also, my insurance company put me on amphetamines. this is really weird. I don't think it will help with my narcolepsy, but I will give it an honest run.
Join the community to add your comment. Already a deviant? Log In
I want to start my own blog, where I'm going to host it I don't know. so I'm just going to post here for now. I'm starting a bold new project to try and make my own proof of concept game engine. It is funny, my last post I talked about how I really wanted to master CUDA, I have abandoned CUDA entirely in favor of OpenCL, which is the same thing as CUDA, but platform independent. Anyway. This is my first post of many to com.


<Post>
So, it has been my intent to figure out how to program a game engine from the ground up for some time now. But I've never managed to get over the difficulty of the interfaces. Let me first define "ground" because this could be vauge. Ground in this case starts where driver interfaces end. Ground level stands on top of Open GL (for graphics), Open AL (for audio), and Open CL (for physics). With these 3 interfaces a professional level game engine can be made. Am I going to make a professional level game engine in this blog? lord no. But with my faithful copy of "Game engine Architecture" by my side, I'm certainly going to make something for the betterment of all young game developers just trying to learn how things work.

For me, one of the hardest steps has been simply trying to over come getting started. What I'm particularly refering to is getting those 3 open interfaces installed and working. Today, for the first time ever, I have succeeded at doing such. this took me months. don't be upset if it takes you some time, and if my information here doesn't help you, start asking on stack overflow. That being said, I'm running Ubuntu 11.04 right now. I will probably post later about how to do this in windows, but if you want to be serious about developing the c and c++ code that I will be talking about here, get yourself on linux. all sorts of options avaliable for doing such, if you are scared, try virtualisation, if you are confident duel boot. if you are bold, reinstall and put windows to rest once and for all. </plug for linux>

With open GL and Open Cl the difficulty rested largely in figuring out why things weren't compiling. I read at least a dozen getting started guides. none helped. say for the last line of one in the opengl wiki (www.opengl.org/wiki/Programmin…). "gcc -o example example.c -lX11 -lGL -lGLU" that is the line for compiling code for open GL in Ubuntu. The thing to know is that Ubuntu comes with OpenGL, stupid simple, but its true. When I had figured that out, things started falling into place. In fact, if you are on a computer w/o a graphics card (netbook for example) the example code from the wiki above should compile from a fresh install.

Open Cl takes a little more. I haven't succesfully implemented it on a computer with out a graphics card yet, so this assumes you have a graphics card. If you are an nVidia user, your graphics card needs to be cuda capable (if it has "GeForce" in it's name, you are good). if you are an ATI user, your card needs to be compatible with the ATI Stream SDK, which I believe is Radeon 5000+. For OpenCL, your graphics card driver should have come with the capacity, but it hasn't been "enabled" in a manner of speaking yet. For nVidia you need to get the most recent CUDA toolkit. It will include the headers needed to compile code. For ATI, the most recent Stream toolkit. With that you have the bare minimum of what you need to get working.

But if you try to compile (gcc -o example example.c -lOpenCL) it will fail, it will tell you that the .h file can't be found. what needs to happen is you need to make a symbolic link. For openCl it is a matter of pointing the includes to the right spot. gcc will lookin the folder /usr/include/ for .h files (or links to them. Create a symbolic link here that will point to where the .h files are:

sudo ln -s /usr/local/cuda/include/CL/ /usr/include/

this will create the link to the open CL libraries. If that doesn't work, then you can tell gcc to add the cuda include path to its search list. this is done with the flag -B. so type in "gcc -B /usr/local/cuda/include/CL/" and it will now look in that directory for the .h files and you should be able to compile.

Lastly there is openAL. It is important to note here that openGL and openCL have no affilation with openAL. GL and CL are open standards kept by khronos group. AL is a cross platform API that sits on top of drivers (such as ASLA, Pulse Audio, EAX, or Direct Audio on windows). Because audio doesn't take quite the effort that graphics and physics do, we can get away with the extra over head created here, for the benefit of having a system that is simple to cross platform. OpenAL is developed chiefly by Creative Audio. It was inspired by OpenGL, where OpenGL strived to create a cross platform, hardware agnostic, graphics card api, OpenAl sought to do the same for 3D audio in computer games. This is where OpenAL differs from khronos's OpenSL. OpenAL provides desktops sound, and is made entirely with games in mind, OpenSL is aimed chiefly at handleds.

Now, there isn't a lot of resources out there for openAL. But for installation in ubuntu, it is very simple "sudo apt-get install libopenal-dev" will install all you need. wa bam.

The next hardest thing for me has been each interface's hello world program. something that show that something has happened. the link i gave earlier for open GL was what finally worked for me. I haven't taken it all apart yet to figure out what does what, but i have something openGl specific running. that is one interface down.

I've never found a good openCL example. the simplest are all so long and do so much. So I'm going to have to create my own. that will be next post.
</Post>
Join the community to add your comment. Already a deviant? Log In

CUDA

3 min read
CUDA stands for "Compute Unified Device Architecture." it is the architecture of nVidia since the GT8 series. when I had first come to hear of it my thoughts were that CUDA was simply a interface that lay atop the graphics card for you to make simple and easy to understand calls to the parallel processing of the GPU. I figured beyond that it didn't change much of the concepts of the graphics card. But I have since been delighted to be proven wrong. CUDA is all the graphics card is. the drivers for the graphics card are most likely written in CUDA.

Recently my graphics card had been over heating and breaking its self. the way I would fix it is pop it into the micro wave for 10 minutes and then it would be fine and dandy for another month. but after doing this 5 times I gave up and got a new graphics card. I was a bit tearful to see my GT8800 go. It has been the most wonderful card I've ever had and I'm not throwing it out so I can always still have it as a back up (if a some what glitchy back up...) in case I should need it. I will miss you GT8800. and here are some lines of silence in you memory.






Now, one of the reasons why I didn't want to loose my GT8800 was drivers. Graphics card drivers are annoying. see this meant that my files that I use for a clean install of windows XP (with those files I take a 3 hour process down to 30 minutes) are now worthless. or so I thought. as it turns out, because the graphics card is just a CUDA processor, the same drivers I used for my GT8800 are the same ones I'm using for my GTX465! these cards are 2.5 years apart but because they have a "Compute Unified Device Architecture" they are vastly similar. the important word in CUDA here being "Unified" the similarities make it simple for the same driver to run many devices. it is rather neato.


But this now kind of re-sparks my interest in CUDA. my GT8800 had 112 CUDA cores in it. my GTX465 has 356 CUDA cores. over 3 times as powerful. also it has twice the RAM at 1GB. The new card is growing on me. While my GT8800 was never really pushed to its limits by my gaming. as soon as I get programming in CUDA, you better believe I'm going to be maxing things out left and write. GTX465, you predecessor never really got stressed as hard as he could be. you though my new little toy, will feel power I've never demanded before. I tried to master CUDA last spring and failed because I was stumbling over C. C has started to cement its self in my brain and I've really taken to it. This spring it will happen! I WILL MASTER CUDA!
Join the community to add your comment. Already a deviant? Log In
I'm just coming to the end of the the book dreaming in code. The information I have gotten from it is profoundly valuable and I HIGHLY recommend it to any programmer, especially collegiate programmers. It has opened my eyes to the travesty that is my profession.

What the crap is up with us? I don't know whether I should brag about the fact that mathematician and artist alike program, or be ashamed of the fact that we can decide on which one it is. oh oh! WRITING code, that means we are like people who right novels right? how about music? no. not really.

The truth be told, that we really don't tend to grasp a lot of the concepts of programing very well. When we are presented with something intangible, we make analogies. and the analogies for programing abound (everything from mathematical proofs to herding lol cats.). The fact of the mater is that there really is nothing like coding. Because that is it's nature. Abstraction is removing distictivity. The more complex the program, the less like anything else it becomes.

Visio diagrams, flow charts, power points, hand out, work flows, manuals, water falls of information on what the program is like, but never really say what it is. Not that such a statement ever could be made. the point of a program is to leave loose ends. imagine a game which comes prebaked with every possible moment, just a series of pictures, you are only given the sensation of playing a game, but in reality it's just a video. that's laughable. Imagine that the other way around, to state what a program really is stating all it's out puts (which is the only way you can really know it works properly and know what it is and what it does). so you have all possible inputs, and all possible out puts. close up shop and go home, you don't need a program.

Programs exist to take care of unpredicted events. Their nature makes the abstract, and they can never surpass the one who programed them. and trying to have 2 or more people working on one program is not like having to people work on building a table or singing a song. This is not just about the people being in sync, your asking them to have one idea which is simultaneously living in both of their heads, not possible.

It may be just because of the builder nature of most programmers, but we have a strange attraction or at least nostalgia for legos. We want our programs to be like legos, plug the blocks together and it works, ~!~TADA~!~ yea, that happens.

The lego dream, and many dreams like it, are not likely to ever be fully realized. Because there is nothing like coding.

My room mate showed me a program tonight called Liquid Story Binder. It is writer's program. it has all sorts of things designed to help you build a book, or movie, or what ever. And I started to think. What would that look like for a programmer? The monsters that are Eclipse, Visual Studio, and the like. Are they really what programmers need? Honestly, I think one of the most interesting programming tools I've used in a long time is Blend3, which was not designed for programming.

I think programmers can improve. But first we are going to have to out which is better, the screw driver or the power drill. Though we may want to figure out which one is which first.
Join the community to add your comment. Already a deviant? Log In

Day 17

3 min read
This is the hard month of my life. It certainly has been that way so far, and I can't say as I see things getting more stressful on me in the future. (as in the future my entire adult hood doesn't hang in the balance any where near as much) I'm taking 18 course credits. but 2 of those are half semester, so I'm doing the work load of 22 credits. I'm also in children's theater, which consumes 19 hours a week. If it were to be compared to a class, it would be a 6 credit class. Which means I have the class load of 28 credits.

I sleep on average 5 hours a night, and still only have 4 hours or so a day (not counting weekends) to do home work. My muscles ache from having so little down time and so much exertion. Children's theater is hard on my body, but I'm also in ballet. even band and choir aren't exactly relaxing times. I have broken into a sweat playing my French horn in a relatively cool room.

I have 13 more days. September 30 children's theater hits it's climax and we coast through 7 weeks of performance. which sounds like it would be worse. but we drop from 19 hours of rehearsal to 3 hours of performance, and maybe a 2 or 3 of rehearsal. so that is a HUGE load of my back. 13 days in this hardest month of my life.

My heart aches, probably from the 4 hours of sleep I got last night. I feel my scalp wants to just jump off my head and leave me. My joints though. oh, they've never been happier. I bend and contort my self in ballet and children's theater so much that they are happy to be worked in a nice health way. My tendons may not be quite as happy, especially the ones that keep popping in my right leg, but i'm sure they'll be happy to as soon as I give them a chance to rest.

My heart metaphorically aches as I ponder still the possibility of sharing it with some one. I have had my hopes invest in a girl now for almost a year. But it is starting to feel like she may not be interested. So I think I'm ready to give up and move on. That very thought pattern makes me feel like my Dad, but this is very much so something different from devoice. How can I loose her when run away from her, if I've never had her in the first place?

Right now, I really just need some one to care for me. I think I'm killing my self with these next 13 days. But I'm committed now, there is no turning back. I will survive these days in the blast furnace of life by God's grace alone. Emerging from the other side as Harden steel.
Join the community to add your comment. Already a deviant? Log In
Featured

Devious Journal Entry by jaqbenny, journal

Littlefood Landmins: Open Interfaces by jaqbenny, journal

CUDA by jaqbenny, journal

Liquid Story Binder by jaqbenny, journal

Day 17 by jaqbenny, journal