9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: 9fans@9fans.net
Subject: Re: [9fans] Drawterm GPU (was: Software philosophy)
Date: Sun, 22 Aug 2021 12:41:06 -0400	[thread overview]
Message-ID: <38625C0884407D776FB7DB6F45B80CC4@eigenstate.org> (raw)
In-Reply-To: <CA+POUViWHP3aUVi+Ji1BtFvmmzE1obaBZ0TYzSNNc6j36p=bZQ@mail.gmail.com>

Quoth Paul Lalonde <paul.a.lalonde@gmail.com>:
> Opinions on how to bring this to Plan9?  I don't really have any - it's a
> huge pile of work with minimal benefit.  If you're looking for lightweight
> graphics, WebGL is a doable path, and almost certainly the right way to
> experiment with Plan9-like interfaces to graphics hardware.

It seems like the interesting part of GPUs
is the general purpose computation. Writing
an interface for pure computation seems like
the way to go.

Hardware rendering is a restricted case of
software rendering; it seems like it would
be better to write code that could do software
rendering, and run it on the general purpose
compute engine of the GPU. The same goes for
basically everything else you may want to do
with a GPU.

It also seems like it may be both a more
useful and more long-lived tool.

Spitballing a while ago on the grid, I came
up with something that looked a bit like a
batch job interface, with a heirarchy that
looks something like this:

        /dev/compute
                new
                $func/new
                $func/$job/data
                $func/$job/result

which you could use from a script like so:

        #!/bin/rc
        # example:
        #
        # runs the neural net for finding cats,
        # which is compiled using some sort of
        # compiler backend that generates spirv,
        <[3=1] <>/dev/compute/new{
                # upload the code which can then
                # be run by the compute engine;
                # statically allocating resources
                # can simplify the driver.
                #
                # protocol would look something
                # like:
                #       "config param\n"
                #       "config param\n"
                #       "code\n"
                #       <spirv-oid bytecode>
                #       EOF
                filtdir=/dev/compute/`{sed 1q}
                echo alloc 8g
                echo code
                cat /bin/spir/catfinder

                # then launch a job, sending it
                # the arguments over the data
                # channel.
                #
                # it's up to the submitter and
                # the compute job to agreee on a
                # format; in this case, a single
                # uncompressed plan9 image is
                # written, and the result file
                # could contain a single string:
                # 'cat', 'not cat', or 'rifle'
                <>$dir/new{
                        jobdir=/dev/compute/`{sed 1q}
                        jpg -9 $i >$jobdir/data
                        cat $jobdir/result >[3]
                }
        }

Prototyping something like this as a 9p server
on unix would be interesting. So would providing
this kind of cpu interface in software.

Vmx could be extended with device passthrough
if you want to fit the entire thing on one box,
and then you may be able to find someone with
a bunch of time on their hands to write a basic
driver... maybe.

Hooking this up to devdraw would probably be
interesting for doing "hardware" rendering, though
latency may be an issue if it's not implemetned as
a local '#' device.

Anyways, this is fun to consider, but I've got
other more quotidian tools to work on before I even
think about thinking about this more :)


------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tad29bfc223dc4fbe-Mc5753788883d2ed17e4acdbd
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

  parent reply	other threads:[~2021-08-22 16:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22 12:10 Stuart Morrow
2021-08-22 12:29 ` sirjofri
2021-08-22 13:44   ` Paul Lalonde
2021-08-22 13:53     ` Eli Cohen
2021-09-01  0:29       ` kokamoto
2021-09-01  7:35         ` sirjofri
2021-09-02  5:01           ` kokamoto
2021-09-02  5:21             ` Eli Cohen
2021-09-03 23:06               ` kokamoto
2021-08-22 14:57     ` sirjofri
2021-08-22 16:45       ` ori
2021-08-22 15:47     ` Bakul Shah
2021-08-22 16:23       ` Paul Lalonde
2021-08-22 19:04         ` Bakul Shah
2021-08-22 19:09           ` Paul Lalonde
2021-08-23  4:13             ` Bakul Shah
2021-08-23  5:23               ` sirjofri
2021-08-22 16:41     ` ori [this message]
2021-08-22 17:29       ` sirjofri
2021-08-22 18:25         ` ori
2021-08-22 18:50           ` sirjofri
2021-09-24  1:50             ` Frank D. Engel, Jr.
2021-08-22 21:10           ` Philip Silva via 9fans
  -- strict thread matches above, loose matches on Subject: below --
2021-08-18 22:00 [9fans] Software philosophy Eli Cohen
2021-08-22  2:46 ` kokamoto
2021-08-22  3:16   ` Eli Cohen
2021-08-22  7:07     ` [9fans] Drawterm GPU (was: Software philosophy) sirjofri
2021-08-22 10:04       ` Frank D. Engel, Jr.
2021-08-22 11:49         ` sirjofri
2021-08-22 12:24           ` Chris McGee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38625C0884407D776FB7DB6F45B80CC4@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).