m11dsauce
Posts: 1
Joined: Wed Jul 11, 2018 7:47 pm

Is there a way to connect 2 RPi's to make a functional computer?

Wed Jul 11, 2018 8:23 pm

I'm brand new to Raspberry Pi computing, so I'm sorry if this is a stupid question.

I was wondering this because I wasn't sure if I could build a pretty good computer to run games on if I used 2 or more raspberry pi motherboards.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 19856
Joined: Sat Jul 30, 2011 7:41 pm

Re: Is there a way to connect 2 RPi's to make a functional computer?

Wed Jul 11, 2018 9:08 pm

A much asked question that I really must put in the FAQ section.

The answer, for your particular purpose, is No.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

W. H. Heydt
Posts: 8535
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Is there a way to connect 2 RPi's to make a functional computer?

Thu Jul 12, 2018 12:01 am

Now that you've been given the answer, let me expand it a bit.

The first thing is: What do you mean by "a real computer"? Not only is a Pi (any model) a "real computer" (in the sense of "a general purpose digital electronic computer"), but it's a lot faster--and therefore, I suppose, more "real"--than many a minicomputer or mainframe I've worked on.

The second thing is: When you say that you want to play games on the computer, you need to specify what sort of computer they are designed to run on. Most games are designed and compiled to run on either a "PC" running some form of Microsoft Windows or some variety of pre-defined console. Games--like most programs--specify a hardware architecture they are compiled to run on. PC games run on the Intel (or workalike) "x86" architecture. Different consoles use chips with a variety of hardware architectures, with each model of console being nearly unique, at least across families. The Pi uses ARM CPUs, aka the ARM architecture. The result of this is that if you want to run a program compiled for one architecture on a different architecture, you have to use a simulator program to fake at least the underlying hardware and usually the operating environment as well. The problem here is that simulators are slow. The way around that is to run the simulator on hardware that is much, much faster than the targeted hardware. thus, you can run games (or other programs) that are meant to run on an MS-DOS system on a Pi because the Pi is far faster than any machine that was intended to run MS-DOS.

The third thing is: There are ways to combine multiple, discrete computers (of any type, not just Pis) to get more processing power. This is the essence of a technique called "clustering". You can read the gory details by looking up "Beowulf Cluster". There are two fundamental issues with this approach. The first is that, in order to be effective, you have to trying to solve a problem that can have various parts run in parallel. Most games, and particularly older games, aren't written that way, so there is no gain to be had. The second problem is that the efficiency of parallel computing is heavily dependent on the connection speeds between the various parts. Here, the Pi is not a terribly good choice becuase it doesn't have any really fast interfaces. Still...building a cluster of Pis can be worthwhile. One wouldn't use it to run games (though you *could* write a game to use one), but--rather--it can be used as a very inexpensive way to learn about parallel computing and how to do it.

Bear in mind that if you just want to learn a bit about parallel computing, you can use a single Pi. This is because all Pis other than the Pi0/Pi0W, A+, B+, and CM have 4 CPU cores and that will allow you to write a program that uses all 4 cores at the same time. (And if you use a single core model...the operating system will make it *look* like you have multiple processes running in parallel...just more slowly.)

ejolson
Posts: 1661
Joined: Tue Mar 18, 2014 11:47 am

Re: Is there a way to connect 2 RPi's to make a functional computer?

Thu Jul 12, 2018 6:03 am

m11dsauce wrote:
Wed Jul 11, 2018 8:23 pm
I'm brand new to Raspberry Pi computing
Welcome to the forum!

As you will hopefully find out, the main way of playing with a Raspberry Pi is by writing computer programs. While creating a game is not the same as playing one, it is also fun and often more satisfying because the result is more than just a high score. Before designing a game that runs on a cluster of networked computers, it would be reasonable to make something simpler using Scratch or Python.

As a historical note, after the first 8-bit microcomputers became cheap enough, hobbyists brought them into the home because they were fun to connect to other devices and fun to program. This resulted in a golden age of computing during which many young people became skilled programmers by the time they were ready to enter the university. The Pi is a modern attempt to recreate an environment where playing with computers by wiring them up to stuff and programming them is fun. So far it has succeeded greatly beyond original expectations.

User avatar
DougieLawson
Posts: 33068
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Is there a way to connect 2 RPi's to make a functional computer?

Thu Jul 12, 2018 7:59 am

Ask yourself this question, "Can I connect two laptops together to make a single faster laptop?". The answer is the same.

Clustering computers is a technique that works by having a workload that can be dissected into small chunks, the small chunks are processed in parallel on the cluster then the results are aggregated into a complete results set.

It's non-trivial to write the programs to break a workload into chunks that can each run as a discrete unit of work. It's non-trivial to rewrite the programs that process those data chunks in parallel. It's non-trivial to build the aggregator. The reason for using Raspberry Pis in clustering is that you can learn those techniques. If you've got a $1,000,000,000 super computer, you don't want to waste processing time on that while folks learn how to program it. The RPi cluster gives you a cheap (but realistic) clustered computer. The I/O bus isn't fast enough to make it useful for processing a large workload.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

Heater
Posts: 9361
Joined: Tue Jul 17, 2012 3:02 pm

Re: Is there a way to connect 2 RPi's to make a functional computer?

Thu Jul 12, 2018 9:11 am

On the other hand...

One of the best games one can play on any computer is creating games to run on it. Figuring out how to program the a game is the game!

Some of the best programmers I have ever worked with cut their teeth as youngsters trying to make games for good old 8 bit machines like the Sinclair Spectrum, C64, BBC Micro etc. They learned all kind of techniques to enable them to squeeze surprising amounts of functionality into a small space and getting to run fast. They learned all kind of shortcuts to get the effects without doing the work.

Then came things like networked Doom. A multiplayer game distributed over a network of PC's.

So, if you have a bunch of Pi and are into games there is the challenge. Create your own multiplayer game for a cluster of Pi. Optimized for the limitations of the Pi.

User avatar
Imperf3kt
Posts: 1017
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Is there a way to connect 2 RPi's to make a functional computer?

Thu Jul 12, 2018 10:02 am

Heater wrote:
Thu Jul 12, 2018 9:11 am
On the other hand...

One of the best games one can play on any computer is creating games to run on it. Figuring out how to program the a game is the game!

Some of the best programmers I have ever worked with cut their teeth as youngsters trying to make games for good old 8 bit machines like the Sinclair Spectrum, C64, BBC Micro etc. They learned all kind of techniques to enable them to squeeze surprising amounts of functionality into a small space and getting to run fast. They learned all kind of shortcuts to get the effects without doing the work.

Then came things like networked Doom. A multiplayer game distributed over a network of PC's.

So, if you have a bunch of Pi and are into games there is the challenge. Create your own multiplayer game for a cluster of Pi. Optimized for the limitations of the Pi.
I dunno about that!
I'm doing such a thing right now, and I think in the last ten minutes I must've lost half a kilo of hair trying to spot why one of my buttons in my main menu is 6 pixels further to the right, than the rest of the buttons, despite using the same class.
User experiencing technical difficulties.

LTolledo
Posts: 196
Joined: Sat Mar 17, 2018 7:29 am

Re: Is there a way to connect 2 RPi's to make a functional computer?

Thu Jul 12, 2018 10:15 am

Even without internet connection, if you attached a keyboard, mouse, monitor, recommended power supply, microSD card with an operating system, then the:

Raspberry Pi is a functional computer

failure to do so will just make it a $35 paper weight .
"Don't come to me with 'issues' for I don't know how to deal with those...
Come to me with 'problems' and I'll help you find solutions"

achrn
Posts: 298
Joined: Wed Feb 13, 2013 1:22 pm

Re: Is there a way to connect 2 RPi's to make a functional computer?

Thu Jul 12, 2018 1:12 pm

LTolledo wrote:
Thu Jul 12, 2018 10:15 am
Even without internet connection, if you attached a keyboard, mouse, monitor, recommended power supply, microSD card with an operating system, then the:

Raspberry Pi is a functional computer

failure to do so will just make it a $35 paper weight .
None of my Pis have attached keyboard, mouse or monitor. Two do not have microSD cards. All are functional, functioning computers, despite your assertion to the contrary.

il_diavolo
Posts: 123
Joined: Mon Dec 02, 2013 7:56 pm

Re: Is there a way to connect 2 RPi's to make a functional computer?

Thu Jul 12, 2018 9:17 pm

None of my Pis have attached keyboard, mouse or monitor. Two do not have microSD cards. All are functional, functioning computers, despite your assertion to the contrary.
You're obviously a very clever pedant.

W. H. Heydt
Posts: 8535
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Is there a way to connect 2 RPi's to make a functional computer?

Fri Jul 13, 2018 12:08 am

il_diavolo wrote:
Thu Jul 12, 2018 9:17 pm
None of my Pis have attached keyboard, mouse or monitor. Two do not have microSD cards. All are functional, functioning computers, despite your assertion to the contrary.
You're obviously a very clever pedant.
Techies and SF fans.... I would hold that a Pi is a functional computer with only some form of mass storage device (SD card or otherwise) and a PSU. (My pedantry mostly revolves around correcting misuse of technical terms. For instance, there is no such thing as a DB-9 connector, despite what many people seem to think.)

fruitoftheloom
Posts: 16767
Joined: Tue Mar 25, 2014 12:40 pm

Re: Is there a way to connect 2 RPi's to make a functional computer?

Fri Jul 13, 2018 2:08 am

To the OP the Raspberry Pi is classed as a Single Board Computer:

https://en.m.wikipedia.org/wiki/Single-board_computer



The PiDramble is a good example of what can be undertaken with a Cluster:

https://www.pidramble.com
Adieu

achrn
Posts: 298
Joined: Wed Feb 13, 2013 1:22 pm

Re: Is there a way to connect 2 RPi's to make a functional computer?

Fri Jul 13, 2018 7:13 am

il_diavolo wrote:
Thu Jul 12, 2018 9:17 pm
None of my Pis have attached keyboard, mouse or monitor. Two do not have microSD cards. All are functional, functioning computers, despite your assertion to the contrary.
You're obviously a very clever pedant.
So when the OP posted about joining two Pis to make a 'functional computer', it was right and proper that he/she be corrected (by you) since it is already a functional computer. However, when you state that it must have keyboard, screen and mouse connected to be a functional computer (and without those things it's nothing but a paperweight), it's pedantry to correct that error. Is that one of those irregular grammatical constructs - 'I am accurate, you are a pedant', that kind of thing?

My backup file server, 3D printer server, home automation controller, weather datalogger, sound player, electricity meter reader, desk-clock and a couple of mucking-about-development Pis all do their jobs without keyboard mouse or monitor. I don't consider it to be pedantry to point out that Pis do not require any human interface peripherals to do useful computing jobs.

Heater
Posts: 9361
Joined: Tue Jul 17, 2012 3:02 pm

Re: Is there a way to connect 2 RPi's to make a functional computer?

Fri Jul 13, 2018 9:00 am

achrn,
'I am accurate, you are a pedant', ...
That's right.

There are pedants and there are sloppy thinkers. Be proud to be a pedant. And a clever one at that.

The notion that a Raspberry Pi is not a functional computer without keyboard, mouse, monitor etc but merely a paper weight is pretty absurd and worthy of correction. I guess it needs a power supply but even an operating system is optional.

I find that my computers are very pedantic. One little mistake on my part and poof, they do not do what I want. I just pendant back at them until the behave. Carbon based thinkers are generally sloppy and get all upset when you correct them.

ejolson
Posts: 1661
Joined: Tue Mar 18, 2014 11:47 am

Re: Is there a way to connect 2 RPi's to make a functional computer?

Fri Jul 13, 2018 4:26 pm

Heater wrote:
Fri Jul 13, 2018 9:00 am
The notion that a Raspberry Pi is not a functional computer without keyboard, mouse, monitor etc but merely a paper weight is pretty absurd and worthy of correction.
I agree. My experience is that the Pi needs to be in a case in order to make a functional paper weight.

I'm not sure the original post was meant to imply that a single Pi is not functional, rather, whether they could be combined to obtain a more powerful computer that functioned to play games. As demonstrated by the fact that every supercomputer in today's world is made by connecting multiple less powerful computers together, it is clearly possible to create a more powerful computer by connecting Raspberry Pi's. However, is the resulting cluster computer suitable for playing games?

To answer that question one needs to know what games. In fact, for many games the quad cores of the 2B, 3B and 3B+ do not function as single computer. The effect is more like having four computers and using one of them to play the game. Similarly many games were not written in a way that allows a cluster to function as one computer. Obviously there are exceptions to this, the most notable being the online role-playing games and tournament mode first person shooters. Many of the backend servers for such games parallelize across multiple cores and clusters while the players themselves leverage thousands of computers and GPUs as the clients. SETI at home is another game well suited for clusters.

Back on topic, to make a functional paper weight using the Pi Zero it is better to cluster them because they are so small. A good example of this is illustrated by the Terrible Cluster on Hackaday.

Image
Note the squares in the above image are not floor tiles but one inch in size.

Roken
Posts: 181
Joined: Sun Dec 31, 2017 4:35 pm

Re: Is there a way to connect 2 RPi's to make a functional computer?

Fri Jul 13, 2018 8:13 pm

Not games, but it is certainly possible to turn over more than one Pi to run a task more efficently than one by itself would, without multi-threading, but with multi-tasking.

For example, any program that uses a database (SQL), and a sound server can be run using three Pis effortlessly. One runs as a sound server, one runs as the database server, and one runs the application using them.

The gains in such a scenario would be negligible (and probably a waste of resources), but it's certainly possible.

For games, they are simply not written that way.
Headless PI. OMG, someone cut it's head off. Oh, hang on. it didn't have one to start with.

Return to “General discussion”

Who is online

Users browsing this forum: Bing [Bot], jardino and 47 guests