I want to tell one success story that happened in my family.
As you know, the performance of a typical home computer, even without expensive components, is already so high that it suffices for ordinary “office” work with a large margin, so the idea of ​​making one computer with several terminals was born by itself. And then I wondered: what about games? After all, on the home computer, in contrast to the office, they usually also play.
And if you make multiseat for office use is very simple, and there are many ways (starting from a terminal connection to the server, ending with running several virtual machines with a hard association of local hardware with them) . Once, a long time ago, I had this idea, but at that time computers still had an AGP connector, which did not mean installing more than one full-fledged video card. Now PCIe is running, and you won't surprise anyone with a motherboard with multiple PCIe slots, so the problem with installing several full-fledged video cards is no longer worth it. ')
So there are no restrictions on the iron line (although there are pitfalls, I will describe them later), it remains to figure out which software to use for this. The last 8 years I have Linux installed on my home computer, so I will use it, specifically kubuntu, but I’ve looked for Windows solutions for interest. Judging by the reviews, the ASTER program allows you to do this, but I have not tested it yet, so I can't say for sure. By the way, the software is paid - about 2000 rubles. Windows MultiPoint Server is also not forgotten, but you don’t use video there. Doing this on OS X is at least impractical because of the price, as a maximum due to the fact that there are simply no Apple computers with powerful game graphics (even the two most powerful FirePro of the last Mac Pro lose one GTX780). So the first idea was to use the XEN hypervisor.
XEN
The idea was this: Linux works in dom0, it immediately plays natively, a video card, USB controller is forwarded to domU, and there you can run anything, of course Windows is more interesting. Conceived - done!
The xen needs a motherboard and a processor with VT-d support, I already had a Core i5-2500 processor, and I would have to change the board anyway, since it was mini-ITX and, accordingly, with only one PCIe slot. With lists of cards that support VT-d are big problems, so you will have to google specifically for each model that is in the store. I can only say that almost all MSI motherboards do not support VT-d, ASRock seemed more likely. As a result, the choice fell on the ASRock H77 Pro4-M. I didn’t have a real gaming card at that time, so the GeForce GTX780 from ASUS was purchased. I like unusual cases, so I bought a stylish and compact SilverStone SG-09 . This is how the computer looked like after assembly:
The Radeon cards are best forwarded, which is why it was bought for the domU. I will not describe the xen setting for pci-passtrough for one simple reason - it did not take off. The reason is that the nVidia proprietary driver does not work with xen. After launch - just a black screen. I wanted to run this case for the test, at least on the processor's integrated card, but she also did not want to run with the intel driver. Only vesa for intel and nouveau for nvidia worked, it was possible to check, but it was impossible to play on it at all. So, experiments with xen were abandoned until better times (after all, the possibility of video card forwarding is more of a technical accident, working on xen developers enthusiasm).
Multiseatx
MultiseatX is a very old opportunity for the X server to become attached to the desired video card, which appeared in the days of the PCI video cards. After the arrival of AGP, there were few opportunities for its use, except that on several outputs of nVidia cards it was possible to run on a separate X-server. Good instruction is here . Since I didn’t need an ATI card anymore, I replaced it with my old GeForce GT 620. There was no particular need for this, but as a Russian I still believe in the myth that ATI does not work well in Linux. In addition, in the case of two nVidia cards, they will be both displayed in the setup program. In fact, setting up MultiseatX in such a configuration turned out to be very simple. In fact, you need to edit only 2 files.
So, we put cards, we connect monitors, keyboards, mice, we turn on the computer. The X server without the xorg.conf file will start on one of the maps. It will not always be the card that the BIOS has chosen, so be prepared to sit at any monitor. Or you can connect remotely via ssh.
The first thing to find out is the addresses of the devices. Let's start with the video card:
The meaningful values ​​for us are 01: 00.0 and 02: 00.0 - these are the addresses of the cards on the PCIe bus. They do not change and depend only on the physical PCIe slot on the motherboard, so that when swapping cards they will need to be adjusted. Next - you need to determine the static addresses of input devices. For some reason, in the ubuntu guide, they use addressing along the way for keyboards, and for mice, they use “symbolic” paths to / dev / input / mouse *. I highly recommend it, as in this case, when connecting the keyboard to another port, it will have to be rewritten, and only in what order to assign the names to the mice is known only to the great random. So the only correct way would be to use real static paths in / dev / input / by-id /.
In the example above, there are 2 keyboards and 2 mice. These paths will be static and will not change when rebooting or connecting to another port. For multimedia keyboards, at least 2 devices will be seen - the keyboard itself and additional keys. The same is true for mice with buttons. The only oddity is that a mouse called Microsoft_Microsoft_Nano_Transceiver is just a wireless mouse, without buttons, and it creates as many as 5 devices. Perhaps they have a universal receiver for the entire series, and this is the reason for the presence of several logical devices. In our case, you only need a device that references mouse2. In order to be sure what is what, you can run cat. When you press the buttons or move the mouse, symbols will appear on the screen.
You can start creating (because in modern distributions it is long gone) of the file /etc/X11/xorg.conf. I will not comment on all the options here, as many of the standard flags in this configuration are already described in the ubuntu.com guide that I have provided.
On it, everything should be clear right away. They write that there is a bug and in multi-seat configurations at least one user with autologin is needed. UPD : updated config. Now the username of another user does not switch vt, but it is already impossible to enter the virtual console.
In general, that's all. Switch to the first console, enter
sudo service lightdm restart
Both monitors should be lit. Login and play!
Underwater rocks
If you put some powerful video cards - forget about the power!
Modern desktop processors have no more than 16 PCIe lanes (English lane), so the usual desktop motherboard will have only one slot with 16 lanes, while the others, although physically, have a size of 16 lanes, but have a maximum of 8 lanes. Apparently, depending on the model of the motherboard, there are different multiplexers (the same ones that are used on dual-processor video cards, like the GTX690). On my matplat 1 connector for 16x, the second on 4x and the last on 1x. But what is most surprising is that even though my processor supports only PCIe v2, even it is more than enough! When playing Dota 2 at maximum settings with a resolution of 2560x1440, the use of the tire barely reached 50%. A weak card does not load even for 10, so even 1x is enough for it. So I advise you not to bother too much about this.
And the working tire width and transmission speed, here:
pulseaudio. It does not start at the second user. The solution is to run as a system daemon. I tried it, it works, but not very well (it does not save all the settings, it is necessary to restart manually). How to start the pulse from several users - I do not know. It seems to me that it is easier to get rid of the pulse in general.
Many valve games have a check to see if the game is already running as a lock file in / tmp. Obviously, this check is buggy and does not allow the second user to start the game. The solution is to remove the lock file. I already wrote a dota in a bugtracker .
Photo and video
Finally, some photos and videos of the working solution:
General form:
Places separately:
So we hid the wires, so they are not visible at all: