Slashdot Mirror


Rootbeer GPU Compiler Lets Almost Any Java Code Run On the GPU

An anonymous reader writes "Today the source code to the Rootbeer GPU Compiler was released as open source on github. This work allows for a developer to use almost any Java code on the GPU. It is free, open source and highly tested. Rootbeer is the most full featured translator to convert Java Bytecode to CUDA. It allows arbitrary graphs of objects to be serialized to the GPU and the GPU kernel to be written in Java." Rootbeer is the work of Syracuse University instructor Phil Pratt-Szeliga.

32 of 304 comments (clear)

  1. Any code? by XxtraLarGe · · Score: 5, Funny

    This work allows for a developer to use almost any Java code on the GPU.

    Except for the code my students write. :rolleyes:

    --
    Taking guns away from the 99% gives the 1% 100% of the power.
    1. Re:Any code? by XxtraLarGe · · Score: 4, Funny

      By the way, this comment is not an indictment of my teaching...

      --
      Taking guns away from the 99% gives the 1% 100% of the power.
    2. Re:Any code? by XxtraLarGe · · Score: 4, Insightful

      There are no bad students, only bad teachers.

      Trust me, there's plenty of bad students. They're only in class to collect their "No Worker Left Behind" check. Thankfully that program has run its course.

      --
      Taking guns away from the 99% gives the 1% 100% of the power.
    3. Re:Any code? by Anonymous Coward · · Score: 4, Insightful

      Speaking as someone who has had the experience of being both a good and a bad student, I will tell you it has very little to do with the teacher. It's all about student attitude. I failed several undergrad classes quite convincingly and it was pretty much my own fault, even though I would have liked to have blamed it on some of the horrible teachers I had. I excelled in grad school because I approached it with a completely different attitude and no teacher, no matter how bad, was going to get in my way and prevent me from doing well.

      I control my attitude. While I admit that no one is impervious to external influences, how a student reacts to a bad teacher is largely up to them. If you allow a bad teacher to turn you into a bad student, that's entirely your own fault. It's not like they've tied you down, cracked open your skull and deliberately rewired things to turn you into that asshole who never shows up or does the work.

    4. Re:Any code? by Anonymous Coward · · Score: 3, Insightful

      I used to think that too, until I started teaching at a state college. The only effective way to teach them is triage. There're the ones who will get it no matter what, the ones who will never learn a thing no matter how well you teach, but there's not much to be done there, short of encouraging the former to explore and helping the latter make it to the pass line. The bulk of the resources need to go to the middle group, where your efforts can make the difference between getting it and not.

    5. Re:Any code? by danbuter · · Score: 3, Interesting

      He'll make far more money welding than most IT guys will. And he'll get a great pension, as long as he joins a welders union (which he probably will, unless you are way out in the boonies).

    6. Re:Any code? by ThePeices · · Score: 5, Insightful

      No, you are quite wrong indeed.

      There are bad students out there, we do not live in a perfect happy smiley little world where every human has limitless potential and can do *anything* if only they tried and had good teachers. That nonsense view comes out of what political correctness has done to modern western society.

      There are students who truly are unwilling to learn, dont want to be there, and are only in class because they have to.

      There are actually students out there who will never be able to pass certain exams, no matter how good the teachers are and no matter how much they try. Some things are just beyond some people.

      The *real world* is not perfect, humans are not perfect.

      If you think that is a cynical view, well then that is utterly irrelevant to my point. Facts are facts, no matter how much we dont or do like that fact.

    7. Re:Any code? by Anonymous Coward · · Score: 5, Insightful

      ...tool & dye....

      "Thinking is hard work, which is why so few people do it." - Henry Ford

      Tool and die. I can understand not knowing how to spell it, bit quoting Henry Ford and not realizing that die work and tooling are technical jobs is abhorrent.

      Tech support is to computer science as die setters are to mechanical engineers.

      Tool and die makers are the software developers of the hardware world.

      Captcha is pompous. How relevant.

    8. Re:Any code? by sydneyfong · · Score: 5, Funny

      I'm here. Hi.

      --
      Don't quote me on this.
    9. Re:Any code? by M8e · · Score: 3, Funny

      Psychotic murderers are the best students.

      (and if they are not they have great potential to become the best.)

    10. Re:Any code? by Charliemopps · · Score: 4, Interesting

      Being a former certified welder, and now a programmer I can tell you that:
      a. I was a GREAT welder. Certified in everything save underwater stuff... I got about $13/hr
      b. I'm not a very good programmer. I just started, don't know many languages and am always bugging my coworkers with noob questions. Now I'm salaried at $60k/yr

      So, I'm not sure how much you think welders get paid. But it's not much. I'm sure there are a few (like the under water guys and the skyscraper guys) but the vast majority of us sitting in machine shops with no aircon, welding liftgates on the back of semis are not making a fortune. Welding was much more rewarding though. I got REAL things done back then. Now I constantly make changes to the same pieces of software and various managers requests. Half the time undoing whatever it was I did last week.

    11. Re:Any code? by Jesus_666 · · Score: 4, Insightful

      It cuts both ways. In the equivalent of high school I had a math teacher I was entirely incompatible with. I dropped from a B to a D in math and stayed there as I failed to learn anything from that man and even lost all enthusiasm for mathematics. Having a teacher you can't work with can be disastrous - not just because of the missed material; you can always learn that on your own. It's because they can suck all the fun out of a field of knowledge until the point where you don't want to make up for what you missed. Yes, you can force yourself to learn it but it's not going to be very effective if you dislike the field (unless you posses a great amount of willpower, which I don't believe I do).

      On the other hand, in university, in Practical CS 1 and 2 (aka "Java for beginners" and "Java for slightly more advanced beginners") we had a setup where students would form groups that do the written homework together and would enter an oral exam at the end where their individual proficiency would be evaluated. In both cases I came out with a good grade while the others of my groups failed. In both cases I was the only one of the group who actually cared about the subject. You can certainly be a bad student without external influences.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    12. Re:Any code? by anethema · · Score: 3, Interesting

      I'm in northern canada, and every welder I know makes over 100k a year. They work in mills, plants, or on the oil patch. I'm sure locale has a lot to do with it.

      --


      It's easier to fight for one's principles than to live up to them.
  2. x264 by girlintraining · · Score: 4, Interesting

    Maybe now the x264 developers will add GPU support and we'll finally have a solution for video encoding that uses the processor and GPUs in parallel. Here's to hoping... :\

    --
    #fuckbeta #iamslashdot #dicemustdie
    1. Re:x264 by Anonymous Coward · · Score: 5, Informative

      Programs don't magically become faster when they are run on GPUs. E.g. Linear Algebra algorithms work really well on CPUs, but if ported 1 to 1 ( as this would ) to a GPU their performance is just abysmal. Usually one needs to use a specially designed algorithm that can actually use the massive parallelism of a GPU and not get stuck e.g. trying to synchronize or doing other kinds of communication. GPUs really like doing the same operation on independent data, which is basically what happens when rendering an image, they are not really designed to have operations that need information of all other data, or neighbouring data in a grid.... . Just because something works on a GPU does not mean its efficient, thus the performance could be much worse using a GPU .
      Also balancing CPU and GPU usage is even harder ( maybe impossible ? ) as you cannot predict what kind of System you will run your software on, thus usually these days the CPU feeds the GPU with data ( with the current Tesla cards only 1 core per GPU, this changes in the Kepler version to 32 ) and does some processing that can't be done on the GPU, but do not share any kind of workloads.

      I don't know how the h.264 codec is structured or if it is possible to have performance gains on encoding. However I really doubt that x.264 can be just ported as they rely heavily on CPU specific features ( SSE etc ) which is quite different to the much higher level bytecode that Java would produce.

    2. Re:x264 by Anonymous Coward · · Score: 3, Interesting

      If you've been following x264 development at all, you'd know that all coders which attempted to add complete GPU acceleration to x264 either failed or have given up because it was too difficult. Their motto has always been 'patches welcome', but the result can't be slower than x264 on a CPU or degrade quality significantly. Thus far not really an issue, since off-hand I can't think of anybody who was actually able to provide a patch which was able to be compiled and produce valid output, let alone have acceptable speed or quality.

      Recently the x264 team was working with an AMD commissioned engineer, yet the only useful thing AMD was able to produce was OpenCL motion compensation, which should land in x264 mainline in the near future. It's not a question of them not wanting GPU acceleration or being stuck up, they literally have been unable to find coders who are knowledgeable and dedicated enough with OpenCL/CUDA to actually produce useful patches. Many of x264 algorithms aren't well suited to the GPU, and as everyone who has attempted this so far has realized, it's no easy task to come close to x264's level of quality on a GPU, while still being faster than the CPU.

  3. Re:How about getting java code to run on java by LodCrappo · · Score: 5, Insightful

    2004 called, they want their blind hate for Java back.

    Used intelligently by a skilled programmer, Java can deliver great results and provide exactly the sort of cross platform capabilities it was designed for. Used by idiots and/or kids who just earned that undergrad CS degree, it tends to provide less.

    --
    -Lod
  4. Re:How about getting java code to run on java by Anonymous Coward · · Score: 3, Informative

    2004 called, they want their blind hate for Java back.

    Used intelligently by a skilled programmer, Java can deliver great results and provide exactly the sort of cross platform capabilities it was designed for. Used by idiots and/or kids who just earned that undergrad CS degree, it tends to provide less.

    Just like any other programming language?

  5. Re:How about getting java code to run on java by SplashMyBandit · · Score: 5, Interesting

    This is simply not true for code written by a professional and competent Java developer (note: part of my consulting gig means I code Java on a professional basis).

    If you write only to the public APIs then Java truly is Write-Once-Run-Anywhere (although some bad Java developers use internal functionality that can change between Java versions - I'm guessing that perhaps these folks are used to coding to the Undocumented APIs of Win32 that you used to have to use to get things done). In Java you shouldn't do this. IIRC, Sun created around ten thousand unit tests to ensure Java worked correctly on each platform (wonderful, they did all the porting and port testing effort so Java developers don't have to).

    Aside from my professional coding (where Java written on a Mac works flawlessly when deployed to Linux and Windows servers) in my spare time I'm working on modern jet air combat simulator in Java. The same Java+JoGL code works flawlessly on Mac, Linux and Windows. Any differences are in capabilities/performance of individual graphics cards (AMD/ATI vs NVidia).

    This article about being able to write Java for the GPU is very interesting, since writing shaders via OpenGL is a little bit of a PITA (there is an impedance mismatch between the conventions of Java, OpenGL and GLSL - it would be fabulous to just write in Java [akin to how I can do this on the Web using Google Web Toolkit]).

    So I don't think your statement is really true - except for buggy software written by developers who have bad simple-platform habits.

  6. Re:How about getting java code to run on java by SplashMyBandit · · Score: 5, Informative

    Usually there is only a problem when your application server (I'm looking at you, stinky Websphere) relies on a particular vendor's implementation of Java (eg. IBM JDK). With recent Sun/Oracle Java Runtime Environments (that is: Java 6, which is around 5 years old; and Java 7) applications usually run flawlessly (at least, mine do - and I'm doing all the usual Java funky stuff: radar, roadsign and head tracking hardware device control, networking, web, 3D graphics, rich clients, etc).

    As a current practitioner in the field I wonder whether your experience is from a long time ago (and polluted by the experience of using software that was based on Microsoft's awful [and deliberately incompatible - which they lost the famous lawsuit over] Java implementation from a long time ago).

  7. Blah its CUDA by zixxt · · Score: 5, Interesting

    It's CUDA only, meaning it does not support any open standards. Call me when when I can target OpenCL.

    --
    ---- GENERATION 26: The first time you see this, copy it into your sig on any forum and add 1 to the generation.
    1. Re:Blah its CUDA by SecondaryOak · · Score: 5, Interesting

      Are you positive it's CUDA only? Browsing the code it does seem to have an OpenCL "backend", at https://github.com/pcpratts/rootbeer1/tree/master/src/edu/syr/pcpratts/rootbeer/generate/opencl

  8. There's hope yet! by oakgrove · · Score: 4, Insightful

    released as open source on github

    Damn, Slashdot, I almost had a freaking heart attack when I moused over (you don't think I actually clicked do you? New here?) the link in the summary and it was to the actual github page rather than some crappy 10 page blog post based on something pulled off the reuters wire from last week.

    I'm impressed!

    --
    The soylentnews experiment has been a dismal failure.
  9. Re:First Post by Anonymous Coward · · Score: 5, Funny

    Um, 'scuse me, you got a license for the use of the word Java in that first post?

    -- Oracle lawweasel

  10. Re:Super by fm6 · · Score: 3, Insightful

    Why is any hack done? Because it can be.

  11. Very nice. by Animats · · Score: 3, Informative

    Here, from GitHub, is the short presentation. This is very impressive. It finds parallelism automatically, at least for simple cases. Over 50x performance improvement on matrix multiply and naive Fourier transform (not FFT), both of which have very simple inner loops. Not clear how it does on less obvious problems.

  12. Re:GPL by ThePeices · · Score: 4, Insightful

    No, *you* get to dictate the licence of your software. It is *you* who chooses to use a GPL library in your code.

    The Author of the GPL code did not put a gun to your head and forced you to choose their code.

  13. Re:How about getting java code to run on java by eWarz · · Score: 3, Interesting

    This is simply not true for code written by a professional and competent Java developer (note: part of my consulting gig means I code Java on a professional basis).

    If you write only to the public APIs then Java truly is Write-Once-Run-Anywhere (although some bad Java developers use internal functionality that can change between Java versions - I'm guessing that perhaps these folks are used to coding to the Undocumented APIs of Win32 that you used to have to use to get things done). In Java you shouldn't do this. IIRC, Sun created around ten thousand unit tests to ensure Java worked correctly on each platform (wonderful, they did all the porting and port testing effort so Java developers don't have to).

    Aside from my professional coding (where Java written on a Mac works flawlessly when deployed to Linux and Windows servers) in my spare time I'm working on modern jet air combat simulator in Java. The same Java+JoGL code works flawlessly on Mac, Linux and Windows. Any differences are in capabilities/performance of individual graphics cards (AMD/ATI vs NVidia).

    This article about being able to write Java for the GPU is very interesting, since writing shaders via OpenGL is a little bit of a PITA (there is an impedance mismatch between the conventions of Java, OpenGL and GLSL - it would be fabulous to just write in Java [akin to how I can do this on the Web using Google Web Toolkit]).

    So I don't think your statement is really true - except for buggy software written by developers who have bad simple-platform habits.

    I would tend to disagree. Why? Because companies like cisco, ibm, etc. all only certify certain versions of java for use in their applications. The cisco apps are cross platform but do NOT play well with different versions of java. I'm not a java expert (I'm a C#/RoR guy) but if fortune 500 companies can't get it right, can you really say that java is cross version compatible?

  14. Legal Problems. by softcoder · · Score: 3, Insightful

    Considering the approach that Oracle is taking of trying to copyright and charge license fees just for using the Java API's (see Oracle vs Google) I cant see any sane person developing on a non-Oracle provided Java platform. If they can sue Google for Dalvik they can certainly sue whoever deploys Rootbeer if they feel like it.
    pgmer6809

    1. Re:Legal Problems. by ultranova · · Score: 4, Insightful

      They can sue. Doesn't mean they're going to win.

      Doesn't really matter who the law would eventually side with, if it takes long enough to do so to bankrupt you.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  15. Re:Here's A Real Programming Language, Boy by sydneyfong · · Score: 3, Insightful

    Congratulations on inventing C++

    --
    Don't quote me on this.
  16. Re:How about getting java code to run on java by SplashMyBandit · · Score: 4, Insightful

    Bro, you simply have a bias against Java and this means you are not reasoning fully. Admit this to yourself. People can (with some effort) write cross-platform C and C++ apps, yet people often write apps that fall over with new service packs to their operating system. Yet you choose to blame a particular technology rather than accept that , "You can write bad FORTRAN in any language".