LTheGreats

LTheGreats

Is there any way to spawn a processes on the GPU?

I am wondering if it is possible to run a process from a beam language on the GPU and if so how?

Being able to spawn a process on the GPU could be cool because it might (depending on how it’s implemented) make the BEAM better at handling lots of floating point math very quickly and since GPUs generally have many more cores than CPUs it would be possible to run a lot more processes truly asynchronously.

I would also like to know some downsides of doing this.

Most Liked

peerreynders

peerreynders

Kevin Smith - Erlang & CUDA: Concurrent and Fast (2011)

slides

Machine Learning in Erlang and CUDA

As already alluded to - the BEAM is used for orchestration of computation - because that is what it is good at.


Aside: Simon Marlow: Parallel and Concurrent Programming in Haskell (amazon.com; GPU Programming with Accelerate)

Qqwy

Qqwy

TypeCheck Core Team

GPUs are completely different animals from CPUs (GPU processors are very small, very limited in what kind of instructions they can execute, but therefore very fast and plentiful.)

Because they are so different, I do not think that a BEAM scheduler would be able to run on there.

If you’d like to make use of the GPU in your code, you might want to look into writing a NIF (such as using rustler and writing it in Rust).

tty

tty

There was research done in the EU with integrating Erlang and CUDA. Just don’t know the details.

ityonemo

ityonemo

Gpu cores are simd. One way to think of it is that you must dispatch the same instruction to all of the cores simultaneously (this is not exactly correct for most modern gpus, but it gives you the flavor of the problem). I do think that the idea of having a process manage a gpu is correct, though, and every other programming language that does gpu stuff does this abstraction wrong. I tried to convince the Julia folks that they should treat the gpu as a virtual “distributed node” that you can dispatch Julia code to (you can do this with distributed cpu nodes on Julia), but they did not pick that idea up.

easco

easco

There is also the Scene library that was presented at ElixirConf.

On the surface it would seem unrelated as it is dedicated to drawing graphics - but it draws those graphics through OpenGL. There is a small step between scheduling graphics on the GPU and scheduling programs to run on the GPU. Scene may or may not have the primitives needed to take that step, but it certainly shows that communicating with the GPU is possible.

Where Next?

Popular in Questions Top

gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
logicmason
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
sabri
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size? Thanks
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

Other popular topics Top

pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement