Servers where some GPUs have displays attached and some don't is trickier than the fully-headless case. The first and obvious issue is that some display IDs are already occupied. That's fixed by picking displays :10, :11, :12 etc, which aren't commonly used. Then the script will actually run!
Unfortunately, it also blanks your physical display, presumably because it's nicking the GPU off of your primary X server. This is fixed for by only looking at GPU buses that nvidia-smi reports as 'not displayed'. That leaves these problems:
So yeah, if you've got a partially headless box and want to fix this up
git clone https://github.com/andyljones/coolgpus.git
cd coolgpus
git checkout partial-head
sudo $(which coolgpus)
and Ctrl+Alt+F2 back to your desktop.
Servers where some GPUs have displays attached and some don't is trickier than the fully-headless case. The first and obvious issue is that some display IDs are already occupied. That's fixed by picking displays
:10, :11, :12etc, which aren't commonly used. Then the script will actually run!Unfortunately, it also blanks your physical display, presumably because it's nicking the GPU off of your primary X server. This is fixed for by only looking at GPU buses that
nvidia-smireports as 'not displayed'. That leaves these problems:xdpyinfoseemed promising, but the extension that presumably has the bus info in - NV-CONTROL - isn't supported.Ctrl+Alt+F2to get back to the desktop. I think this is something to do with X 'resetting' VTs, because the same problem was originally showing up every timenvidia-settingswas called. That was suppressed by-novtswitchand passing a new VT ID, but the blank-on-launch persists.So yeah, if you've got a partially headless box and want to fix this up
and
Ctrl+Alt+F2back to your desktop.