Daniel Ennis (Aikar)

NVIDIA SLI + Triple Display on Ubuntu 14.04!

For many months I’ve had a 3rd monitor on my desk, but could not use it as I could not get it to work. Any time I enabled the monitor using Xinerama, the desktop would freeze on login.

I’ve now learned about how the whole XOrg and Nvidia Settings system works.

The trick is that many of the display settings for the nvidia driver are no longer relevant to Xorg.conf, and are now actually in a file in your home directory called .nvidia-settings-rc.

If you are having problems try wiping this file out, and also wipe out your /etc/X11/xorg.conf

Then, if you have SLI cards, issue sudo nvidia-config –sli=on

If you have a single card but MultiGPU, issue sudo nvidia-config –multigpu=on

If you have a SLI MultiGPU card (4+ GPU) then you only need sli, as Xorg.conf told me that multigpu was not necessary at that point.

I’m using the latest Ubuntu 14.04 nvidia-331-updates-uvm driver, which is running more stable than the nvidia-343-uvm from xorg-edgers ppa, so I do not recommend updating to 343.

Once you reboot, run the nvidia settings and ensure Base Mosaic is enabled, and enable all of your monitors in the order you want, and click the Save to X Config button.

But one detail I did not know that caused me so many issues in the past – that all of the OTHER nvidia settings has to be saved separately to that nvidia-settings-rc file.

This file should be saved automatically on close of the settings app, but to be sure go to the nvidia-settings Configuration panel and hit the save button, and simply select your home folder that it opens up to.

Now one important note, when you hit the Save to X button, its going to wipe out your SLI/MultiGPU option! So you need to go back and re-run sudo nvidia-config –sli=on or –multigpu=on to reset that setting.

Now you should be good to restart and have your working setup! I was able to get over 400 FPS in Minecraft (which given its simplicity of graphics, it is a Java game and not the best for performance).

I now have 2 more monitors on the way for Wednesday so I can be close to that “Geek Dream” of a 6+ monitor setup (I’ll be at 5 for now), but hoping to not have any issues with them.

Good luck 🙂

Apache 2.4, PHP 5.5 with php-fpm and mod_rewrite

This guide was updated on April 28, 2016 with some missed details!
– Added timeout and flush params to the External Server command, and added missing -socket
– Added missing apache modules actions and alias

So recently I’ve had trouble with the host I had been using for years (bad support, billing broke, DDOS Attacks on their other customers constantly affecting me), so I decided to move my web infrastructure to the same datacenter I run all of our game servers out of, HiVelocity. I decided to fully build this server out fresh instead of trying to clone the old one, and do things better this time around.

First I had recently done research into the performance impact of using Apache MPM-Prefork with mod_php, in that every Apache process has PHP loaded, so even static requests have PHP loaded – eating lots of resources!

I had heard about FastCGI as I had it when I used shared hosting back in the days with SuExec, but now I found something better: PHP-FPM – A special FastCGI based pool that is designed for PHP itself.

Win! so I set up Ubuntu 14.04.1 LTS, Apache 2.4 and went with the newer MPM Event module, which appears to do even better with Keep Alive requests.

So lets get Apache 2.4 with MPM-Event, PHP5 FPM and some PHP5 Modules going:

sudo apt-get install apache2-mpm-event libapache2-mod-fastcgi php5-fpm php5-cli php5-apcu php5-sqlite php5-gd php5-json php5-curl php5-mcrypt php5-mysqlnd php5-redis

By default it should be configured to use sockets, but if not, check in /etc/php5/fpm/pool.d/www.conf for:

listen = /var/run/php5-fpm.sock

And change it if its using a TCP port instead. Unix Sockets are faster as it avoids the TCP protocol.

Next up add /etc/apache2/conf-available/php5-fpm.conf and paste this in:

<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization -idle-timeout 900 -flush
<Directory /usr/lib/cgi-bin>
Require all granted
Require env REDIRECT_STATUS
</Directory>
</IfModule>

Now to enable these things! You need Actions, Alias, FastCgI and Rewrite modules for Apache.

sudo a2enconf php5-fpm
sudo a2enmod actions alias fastcgi rewrite

now here is the part that caused me so much trouble for an entire week! If you want to have mod_rewrite work, you need to edit /etc/apache2/apache2.conf and find the <Directory /var/www/> stanza

By default this has AllowOverride None, and you need to change that to AllowOverride FileInfo

Without this, rewrite rules will not work.

Following this, you should pretty much be set up with a working PHP5-FPM, with mod_rewrite on Apache MPM Event, and have Apache use a lot less resources in general.

I’m sorry if anything in this is off – I went through so many things trying to get everything working, but this is to the best of my knowledge what the final results were.

Please submit any corrections!

The problems with Bukkit and Contributing

I spend quite a lot of time improving the CraftBukkit’s core code, in order to make it perform better, more efficient and overall do things in a better way. I’m responsible for some of the biggest performance improvements that’s been made to the Minecraft Server.

However, if you’re not apart of the Spigot community, it’s likely you’ve not seen my name before. That’s because I’ve barely had any PR’s accepted to the CraftBukkit project.

It’s not for a lack of trying, it really all boils down to politics and policies.

I feel that CraftBukkit’s PR Policy is a reason the project went further downhill. There are countless people like myself that want to work to make the project better, but do not have the time to deal with the politics.

I’m speaking of the “holier than thou” attitude that the (original) CraftBukkit team (well, specifically certain members who handled PR’s) attitude.

It’s not that I’m lazy, it’s quite the opposite: I’m BUSY. I work a full time job to pay the bills, then another full time job to run my own Minecraft Server. I don’t have the time to contribute to Bukkit or Spigot, but I do it any ways especially when it can benefit my own server.

Every experienced developer knows designing a solution and testing and working all the bugs out is the hard part of writing code, not the syntax or styling details. However, COUNTLESS Pull Requests are closed on Bukkit purely due to minor things.

I look at it this way, if all that is “wrong” is a simple white-space on a single line or a 3 line change, then just make the fix yourself when pulling it!

This PR for example: https://github.com/Bukkit/CraftBukkit/pull/1352

Only feedback was formatting errors essentially which I resolved, then it sat for many months untouched. It then of course conflicted with newer commits.

The problem is Bukkit thinks everyone contributing is sitting around, waiting to make the next change to get it accepted. But, we can’t do that. We have other things to work on. My focus has been switched and I’m now working on the next task.

To have to stop what I’m doing, switch back to a different project/checkout, add a space and recommit and push… It’s hard to justify stopping work on something significant for such a small thing.

Essentially, Bukkit thinks we should lose 10-30+ minutes of our time, and most importantly: break concentration (and we all know how bad that is) for meaningless politics just so that the Bukkit team member doesn’t have to do a single change to the code, to save them 2 minutes.

I disagree with this ideology completely. When you are a team member of a successful open source project, your goal should be to make that product great. If someone took their time to solve a complicated issue, and bring it to production readiness, it is fairly reasonable for you to spend 5-30 minutes when pulling it to fix up tiny things, verify it works yourself, and fix up things that you want changed that does not interfere with the logic of the change itself (styling, whitespace, imports, etc).

The only reason you should be sending a PR back to the submitter is if you have a concern with the implementation, or need more details to understand the change yourself.

A project maintainers time is no more important than the contributors, and remember, its not the contributor who’s going to get the mass-praise over a major new change – its the project itself and its developers, even when they didn’t even do the hard part of a change.

Be happy that someone is helping you improve your product, and work WITH them to improve your product.

Mojang: My suggestion to you – Put someone in charge of the project who is enthusiastic about making the project great. Someone who gets excited when someone is working on “the next big change” for them, and is eager to work with them and discuss it and push for it to be included.

Please build a team of FRIENDLY people, people who are not going to personally insult everyone who tries to have low level talks, and someone who is not going to try to make others feel lesser than them.

Loosen up the PR process, and give people realistic hope that a PR might actually be pulled before the next major upgrade that conflicts the PR.

Another thing to do is encourage low level discussion and “potential” talk. Numerous times I tried to discuss the feasibility of whether or not CraftBukkit would even CONSIDER an idea. I wasn’t about to go spend 12+ hours working on a change to just be told “We don’t want to maintain a change of that scale” or “we don’t think the API should offer that”.

But every time I was told to go do it then bother them with it… And discussing the idea without showing results was met with insults.

That can not happen any more.

Spigot isn’t perfect, but is a much better place than Bukkit was, so if you can at least match Spigot, then you will have done great things for the Bukkit project.

If any Mojang member (Dinnerbone?) wants to discuss this more with me, I’m on IRC (Esper, Spigot, FreeNode) as Aikar every day.

Here’s hoping Dinnerbone is true to his word that Bukkit will be better than before!

 

Blog Activity on Aikar.co?

Yes, you’re eyes are not deceiving you. I am writing!

Though, I am cheating and doing many of these post all at once and scheduling them, but I am wanting to get more content up on this blog to share some of my recent learnings with building out my new server.

So, here is to some post.

I will be sharing my post with G+/Twitter/FB(Only if you Follow me, please do not Friend Request, I don’t friend many internet-only people) – So Follow me there for updates!

http://gplus.to/aikar

Ubuntu System Freeze on X58 Motherboard – Solved!

I wrote in another article on how I was having some system instability issues, where the CPU would stall, and everything stopped, no SSH, no TTY, no REISUB, dead!

BIOS updates did not help, changing hardware settings did not help, and I was about ready to sell this PC…

But I found the problem finally!

In the X58 Motherboard, at least this Classified 3, Intel Turbo is on and CxE function is off by default.

Turning Turbo off and CxE to C6 has solved my issue. It appears Turbo is trying to overclock the CPU, and the voltage shortage is freezing things up. Why a default setting can result in such a level of instability is beyond me… but these 2 settings has 100% been the solution to my issue. No more hard shutdowns!

I hope this helps someone else!

Mojang is killing Minecraft

Another Thursday, another snapshot. Another use of the A word: “Adventure Mode”.

This is really getting ridiculous.. Mojang is killing Minecraft. Update after update we are seeing all these things added for Adventure Mode. Yes, Adventure mode… that thing no-one in multiplayer uses.

Mojang is putting too much effort into the single player features of Minecraft. They really do not want people to play Multiplayer Minecraft. So many changes kill the performance of Minecraft in multiplayer, but, it runs fine in Single Player or 4 man LAN games! So it’s all good!

But…. You know what has made Empire Minecraft so strong? Our community. Our server is designed around players playing the game with tons of other friends. That strength in community, playing together, creates a unique bond of loyalty.

However, Mojang does not get this. Instead, everything is designed for Adventure Maps, just to make YouTubers happy. This results in many players leaving their home server just to start a local one to play some adventure map with the new features that the latest update added…

So these players now leave their home server, then get bored of what ever they just did in the small server, and in essence then feel bored of Minecraft. Mojang is creating an ecosystem designed around short term satisfaction.

This is extremely unhealthy for the long term viability of the game. How about designing things that benefit large multiplayer servers? Design things that will keep people entertained for weeks or months. Design things that encourage playing with friends and meeting new people.

That is what I am trying to accomplish with Empire Minecraft, a strong community founded on playing the game together. But it doesn’t help that we have to constantly work on updating to the latest version to include new blocks/terrain (destroying that long term aspect of a single world, what’s the point creating something huge if worldgen changes in 2 months and now your world is not that smooth?), and a bunch of features that mean nothing to multiplayer servers…

Work with the community Mojang, and not the “YouTube Community”, the “Everyone else” community. Stop fighting us.

The quest for triple head on Ubuntu with SLI GPU

I recently purchased a system from my friend to upgrade my old system, as I really wanted 3 monitors…

So, I might of bought a “Gibson” (No, not the guitar, if your on my blog you should get the reference!), but sadly I had tons of trouble getting the 3rd monitor to work under Ubuntu 13.10!

Enabling Xinerama in older nvidia drivers caused the system to hard freeze immediately on login.
Installing nvidia-331 from a third party PPA gave an option for “Base Mosaic”, but same issue….

However, I have been having extremely annoying problems with the system CPU freezing every so often having to hard restart… Ruled out hardware issue, works fine in Windows, but over 2 different 13.10 installs (one was a constant upgrade from 10.04, other was fresh to resolve many other issues I had), the problem was very consistent.

So, it was obviously an ubuntu specific problem. Well, one idea was to try installing 12.04, so I did that last night. Went to install nvidia driver (as I couldn’t even properly boot into the system with these SLI 590 GPU’s) and noticed a new driver on the list… nvidia-331-uvm.

Apparently this is some newer tech from nvidia for improving performance, but either it being uvm or 12.04, Base Mosiac now works.

So, if you are having problems with multi GPU (I have 4 GPU’s with these SLI cards), try 12.04 (or 14.04 when it is out) with nvidia-331-uvm or higher!

Now… here’s hoping 12.04 also fixes my lockup issue!

I’m Back!

I’m going to really start to post more on this blog now. Namely about Minecraft, programming, and my personal weight loss findings and progress.

So if this interests you, check back often 🙂

Ubuntu – Could not calculate upgrade 13.10

Just wanted to share some information I found. Many may face this daunting error “Could not calculate upgrade”, and will find post telling them to type

 

“grep Broken /var/log/dist-upgrade/apt.log”

 

Well, I had a ton of broken packages, but I noticed all of them mentioned ~ricotz0

 

Broken brasero:amd64 Depends on libgtk-3-0 [ amd64 ] < 3.8.1+git20130422.0ce7854a-0ubuntu1~12.10~ricotz0 -> 3.8.6-0ubuntu2 > ( libs ) (>= 3.0.0)
Broken brasero:amd64 Depends on libnautilus-extension1a [ amd64 ] < 1:3.6.3-0ubuntu16 -> 1:3.8.2-0ubuntu2 > ( libs ) (>= 1:2.91)
Broken brasero:amd64 Depends on gnome-icon-theme [ amd64 ] < 3.7.3+git20121224.2af6b37d-0ubuntu1~12.10~ricotz0 -> 3.8.3-0ubuntu3 > ( gnome )
Broken libgtk-3-0:amd64 Depends on libgtk-3-common [ amd64 ] < 3.8.1+git20130422.0ce7854a-0ubuntu1~12.10~ricotz0 -> 3.8.6-0ubuntu2 > ( misc ) (= 3.8.1+git20130422.0ce7854a-0ubuntu1~12.10~ricotz0)
Broken libgtk-3-0:amd64 Depends on libwayland0 [ amd64 ] < 1.0.5-0ubuntu1 > ( libs ) (>= 1.0.2)

 

I recognized that to be a PPA I once had, the gnome testing… but I don’t have it right now! So I had no ppa to purge.

However, simply adding it then ppa-purging it removed the PPA and downgraded all of the packages.

This will help resolve the issue for most people exeriencing this problem (I happened to still have problems, but eventually something got it to work).

Hope this helps.

Where’s Aikar

Blog’s been pretty dead, that is clear. I’ve yet again switched projects last year and now doing full on Java Development!

I am now the lead developer for Empire Minecraft. I am getting to work on some stuff that has always interested me: Gameplay Design and Development.

In Minecraft, I manage a custom version of the Minecraft Server software, as well as fully develop a custom built platform for the game to provide a unique Survival Server experience.

We focus on long term community impact, in aiming to give players constant content to play on, but keeping the game close to the “Vanilla” feel, so we like to call our server “French Vanilla”.

I also met my now Fiancee on Empire Minecraft… so you could say things got very interesting in life, but keeping busy 🙂

Follow me over at Empire Minecraft, but will try to do more post here.

I am Senior Software Engineer and Entrepeneur. I am an enthusiast and love creating things. I operate my own side company in my free time called Starlis LLC, working in Minecraft.

I enjoy doing things right and learning modern technologies.