I Need Help Bringing Vulkan to Racket

142 views
Skip to first unread message

Sage Gerard

unread,
Oct 9, 2019, 4:56:48 PM10/9/19
to users\@racket-lang.org
I'm resuming work on a very early-stage project that generates FFI bindings for Vulkan in Racket [1]. VkTk is the closest relative project I have found for reference [2].

Last time I was on the project I was focused on generating bindings from the API registry. That has not changed. I considered use of Dave Herman's C library [3] on vulkan.h directly, but the XML spec has supplemental data, and vulkan.h has preprocessor directives that I would like to capture for completeness.

Once I am finished with the bindings. would anyone be available to contribute/run tests in the hopes that we can make this viable faster? I intend to run any applications on Windows 10 and a 1080Ti, but that's about all of the configurations that I can verify. I'll definitely need guinea pigs and feedback.


~slg


Jay McCarthy

unread,
Oct 9, 2019, 6:36:04 PM10/9/19
to Sage Gerard, users\@racket-lang.org
Hi Sage,

You should model your implementation of Stephan's RacketGL --- https://github.com/stephanh42/RacketGL --- which parses the spec.

If you also want to or need to capture parts of the headers, I recommend David Benoit's dynamic-ffi --- https://github.com/dbenoit17/dynamic-ffi --- for parsing them with Clang's library, rather than going with something home grown.

I am very interested in making mode-lambda work on Vulkan. I have a Windows computer that I could test on.

Jay

--
Jay McCarthy
Associate Professor @ CS @ UMass Lowell
http://jeapostrophe.github.io
Vincit qui se vincit.


--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/RsANZblSLyJViX1EDgDg-umCCJKCS6uYV84htPiRjjgAuW7G_3nx-fAOrLD7VMDqtEDkSKbm16jPyTWsAk1QyXCF8cz2CUi-mP04jrpmgn8%3D%40sagegerard.com.

Hendrik Boom

unread,
Oct 9, 2019, 9:17:38 PM10/9/19
to us...@racket-lang.org
On Thu, Oct 10, 2019 at 07:36:33AM +0900, Jay McCarthy wrote:
> Hi Sage,
>
> You should model your implementation of Stephan's RacketGL ---
> https://github.com/stephanh42/RacketGL --- which parses the spec.
>
> If you also want to or need to capture parts of the headers, I recommend
> David Benoit's dynamic-ffi --- https://github.com/dbenoit17/dynamic-ffi ---
> for parsing them with Clang's library, rather than going with something
> home grown.
>
> I am very interested in making mode-lambda work on Vulkan. I have a Windows
> computer that I could test on.

And I have a systemd-free Linux system to test on.

-- hendrik

>
> Jay
>
> --
> Jay McCarthy
> Associate Professor @ CS @ UMass Lowell
> http://jeapostrophe.github.io
> Vincit qui se vincit.
>
>
> On Thu, Oct 10, 2019 at 5:56 AM Sage Gerard <sa...@sagegerard.com> wrote:
>
> > I'm resuming work on a very early-stage project that generates FFI
> > bindings for Vulkan in Racket [1]. VkTk is the closest relative project I
> > have found for reference [2].
> >
> > Last time I was on the project I was focused on generating bindings from
> > the API registry. That has not changed. I considered use of Dave Herman's C
> > library [3] on vulkan.h directly, but the XML spec has supplemental data,
> > and vulkan.h has preprocessor directives that I would like to capture for
> > completeness.
> >
> > Once I am finished with the bindings. would anyone be available to
> > contribute/run tests in the hopes that we can make this viable faster? I
> > intend to run any applications on Windows 10 and a 1080Ti, but that's about
> > all of the configurations that I can verify. I'll definitely need guinea
> > pigs and feedback.
> >
> > [1]: https://github.com/zyrolasting/racket-vulkan
> > [2]: https://github.com/awolven/VkTk
> > [3]: https://docs.racket-lang.org/c-utils/index.html
> >
> > *~slg*
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to racket-users...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/racket-users/RsANZblSLyJViX1EDgDg-umCCJKCS6uYV84htPiRjjgAuW7G_3nx-fAOrLD7VMDqtEDkSKbm16jPyTWsAk1QyXCF8cz2CUi-mP04jrpmgn8%3D%40sagegerard.com
> > <https://groups.google.com/d/msgid/racket-users/RsANZblSLyJViX1EDgDg-umCCJKCS6uYV84htPiRjjgAuW7G_3nx-fAOrLD7VMDqtEDkSKbm16jPyTWsAk1QyXCF8cz2CUi-mP04jrpmgn8%3D%40sagegerard.com?utm_medium=email&utm_source=footer>
> > .
> >
>
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAJYbDa%3DotA_tNaD1troPWF9XDoj_hg0dMKKpiR1xQV%2BKMip%2BHQ%40mail.gmail.com.

Sage Gerard

unread,
Oct 14, 2019, 12:16:30 PM10/14/19
to Jay McCarthy, users\\@racket-lang.org
Thanks for the advice, Jay.

I installed dynamic-ffi and could not get the initial example to work, presumably due to my own error: https://github.com/dbenoit17/dynamic-ffi/issues/25

~slg


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

Paulo Matos

unread,
Oct 21, 2019, 11:18:36 AM10/21/19
to Racket Users


On Wednesday, 9 October 2019 22:56:48 UTC+2, Sage Gerard wrote:
I'm resuming work on a very early-stage project that generates FFI bindings for Vulkan in Racket [1]. VkTk is the closest relative project I have found for reference [2].

Last time I was on the project I was focused on generating bindings from the API registry. That has not changed. I considered use of Dave Herman's C library [3] on vulkan.h directly, but the XML spec has supplemental data, and vulkan.h has preprocessor directives that I would like to capture for completeness.

Once I am finished with the bindings. would anyone be available to contribute/run tests in the hopes that we can make this viable faster? I intend to run any applications on Windows 10 and a 1080Ti, but that's about all of the configurations that I can verify. I'll definitely need guinea pigs and feedback.


Hi Sage,

Thanks for this effort.
I have a large machine - currently used for Racket CI, which could be used for running these tests as well. A separate machine specifically for benchmarking is available as well.
Give me a pvt. shout to arrange this.

Paulo

Leif Andersen

unread,
Oct 21, 2019, 3:31:13 PM10/21/19
to Paulo Matos, Racket Users
Oh cool.

I've never actually looked at this dynamic-ffi package. Although IIRC,
the RacketGL bindings themsleves were generated by swig:
http://www.swig.org/
>> *~slg*
>>
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/9ee51764-bbbe-4328-8d04-8a3d18a65649%40googlegroups.com.
>


--
~Leif Andersen

Sage Gerard

unread,
Oct 21, 2019, 3:42:47 PM10/21/19
to Paulo Matos, Racket Users
Thanks Paulo, I will follow up off-list.

On-list: The bindings are now functional for the simplest possible Vulkan instance lifecycle (create, destroy, end of process). I'm having trouble learning how to create wrapper procedures that do not behave any differently from underlying C functions. Relevant user list thread: https://www.mail-archive.com/racket...@googlegroups.com/msg42764.html

Until that's figured out, nothing using two-step allocations using the same function will work (e.g. device enumeration, queue feature detection).

With luck, this is the last hurdle to writing a non-trivial application and getting more people involved.

~slg


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

Hendrik Boom

unread,
Oct 21, 2019, 6:18:04 PM10/21/19
to Racket Users
On Mon, Oct 21, 2019 at 07:42:39PM +0000, Sage Gerard wrote:
> Thanks Paulo, I will follow up off-list.
>
> On-list: The bindings are now functional for the simplest possible Vulkan instance
> lifecycle (create, destroy, end of process).

Does that mean there is something to test already, however trivial?
Can i try this test on my machine?

(I know nothing about Vulkan and have never used it directly, but I think I installed it
on my Devuan Linux system.)
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/racket-users/9ee51764-bbbe-4328-8d04-8a3d18a65649%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/9ee51764-bbbe-4328-8d04-8a3d18a65649%40googlegroups.com?utm_medium=email&utm_source=footer).
>
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/VPgfhdDOjHzoxPz1iIZBQFViGpcabLvrCTvnStrSlCMrbSN6sjdvmldu3JPwCZEg0FS8IcjUxcNYlxN5VhUWWG7Jv4aHHkMMHPdVWp3LuOM%3D%40sagegerard.com.

Sage Gerard

unread,
Oct 21, 2019, 6:25:26 PM10/21/19
to hen...@topoi.pooq.com, racket...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages