Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32421

Re: question: in order to use java on/in a graphics card

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: question: in order to use java on/in a graphics card
Date 2015-08-23 16:03 -0400
Organization A noiseless patient Spider
Message-ID <mrd8rp$bup$1@dont-email.me> (permalink)
References <6012dfa0-59b3-4b84-8d79-e6ccbc7f6030@googlegroups.com> <mrd0l0$7cp$1@dont-email.me> <eed15966-0b0c-4fac-8f36-dca2fd4d9727@googlegroups.com>

Show all headers | View raw


On 8/23/2015 1:58 PM, gdotone@gmail.com wrote:
> On Sunday, August 23, 2015 at 1:43:50 PM UTC-4, Eric Sosman wrote:
>> On 8/23/2015 11:18 AM, gdotone@gmail.com wrote:
>>> question: in order to use java on/in a graphics card, where java is directly producing the action of the card, the card must have a JVM to produce byte code the the graphics processor can deal with?
>>
>
>>
>>       Java applications can draw graphics via a number of libraries
>> and layers: AWT, Swing, SWT, JavaFX, and perhaps more ... but I
>> suspect that's not what you're asking about.
>
> you are right, that's not what i'm asking. amd and nvidia produce drivers for their cards. those drivers appear to be written in c, to get close to the hardware. they may even use an assembly language for part of the code to control them.

     Although I have no specific knowledge of the particular cards that
interest you, your outline seems plausible.  The card will most likely
have some on-board firmware, a hookup with the host's I/O mechanisms,
and probably some kind of sub rosa hookup to the (or "a") memory bus.
The driver for a specific card+host+O/S combination will take care of
mediating between an application-level graphics framework and the low-
level on-card and near-card operations, and of keeping the O/S informed
about what's going on.

> in order to create drivers for those cards using java, would a jvm need to be created for the processors and cards.

     Probably not.  A driver written in Java would presumably run on the
host processor, not on the graphics card.  It would still have the job
of translating "shade this polygon with that texture" into whatever the
card understands, and the possibly more intricate job of passing data
back and forth between the card and the O/S' structures.  Interrupts,
if the card uses them, could be REALLY tricky to handle in Java, where
the garbage collector might launch at any moment.

     By the way, the details of driver/card interaction are not always
readily available: The makers of the cards often regard such matters
as proprietary, and will not document them for you.  That means you
may well need to reverse-engineer the vendor's driver just to find out
what a substitute driver must do.  Even if you figure out what the
vendor's driver is doing, there may still be requirements you're not
aware of: For example, it might be necessary to respond to such-and-
such an event within so-and-so many nanoseconds, and the fact that
the vendor's driver just happens to do so won't reveal the need.
Finally, reverse-engineering somebody's proprietary driver is the
sort of thing that a typical EULA frowns on, and that a sufficiently
vindictive card maker might take exception to.

     ... but, hey, no worries: Intel and AMD never sue anyone, right?

> the idea here is to eliminate the use of c.

     The driver will surely need to do some low-level things unaided
Java cannot, like "tickle the I/O register at such-and-such address"
or "arrange to be the recipient of thus-and-such interrupt" or "lock
Semaphore So-And-So while fiddling with an O/S-internal queue."
Since unaided Java can't do it, you'll need to write a considerable
amount of JNI code -- and what do you plan to write it in, eh?  COBOL?

     Then there's the JVM itself, which is a very large pile of C++
(with assorted admixtures).  C++ is not C, but still ...  And what
do you suppose the O/S itself is written in?  And the on-card firmware?

     What benefit do you expect to derive from eliminating C, if it's
even possible at all?

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

question: in order to use java on/in a graphics card gdotone@gmail.com - 2015-08-23 08:18 -0700
  Re: question: in order to use java on/in a graphics card Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-08-23 13:43 -0400
    Re: question: in order to use java on/in a graphics card gdotone@gmail.com - 2015-08-23 10:58 -0700
      Re: question: in order to use java on/in a graphics card Thomas Richter <thor@math.tu-berlin.de> - 2015-08-23 20:05 +0200
        Re: question: in order to use java on/in a graphics card "g.g." <gdotone@gmail.com> - 2015-08-23 11:19 -0700
          Re: question: in order to use java on/in a graphics card Thomas Richter <thor@math.tu-berlin.de> - 2015-08-24 09:15 +0200
            Re: question: in order to use java on/in a graphics card Haddock <ffm2002@web.de> - 2015-08-25 02:30 -0700
              Re: question: in order to use java on/in a graphics card gdotone@gmail.com - 2015-08-25 13:02 -0700
                Re: question: in order to use java on/in a graphics card gdotone@gmail.com - 2015-08-25 13:03 -0700
      Re: question: in order to use java on/in a graphics card Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-08-23 16:03 -0400
  Re: question: in order to use java on/in a graphics card Eternal Hope <laughingspam99@gmail.com> - 2015-08-23 21:26 +0100
    Re: question: in order to use java on/in a graphics card Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-23 21:38 +0000

csiph-web