Faster Intel graphics on FreeBSD

If you have a laptop with an Intel graphic card and architecture above Sandy Bridge (circa 2011), you can accelerate xorg significantly with this little hack. Create the file /usr/local/etc/X11/xorg.conf.d/intel.conf:

Section "Device"
  Identifier "Intel Graphics"
  Driver     "Intel"
  Option     "AccelMethod" "sna"
EndSection

See the manpage intel.4. It seems that the version of xf86-video-intel on FreeBSD falls back to the UXA acceleration method but forcing SNA provided good results on my ThinkPad X250.

Intel kernel panic

If you recently had your FreeBSD 12.1 running ThinkPad X250 (or any other laptop with a Intel GPU) crashing systematically on boot, it may be because of the i915kms module from the graphics/drm-kmod port. If you did install this or drm-fbsd12.0-kmod through the packages, you should know that the binary package is only compatible with FreeBSD 12.0. If you want this to work (that is, not to cause a kernel panic), you should compile the port manually [1]. In other words:

portsnap fetch update
cd /usr/ports/graphics/drm-fbsd12.0-kmod
make install clean

FreeBSD on Intel Broadwell

Around two years ago I posted about using FreeBSD 10 on the X250. A great deal has happened since then.

It is now possible to use the Intel Broadwell integrated graphic card (among others) under FreeBSD-CURRENT FreeBSD-STABLE! Also if I’m right, this will be integrated in FreeBSD 11.2-RELEASE. What a great day it is for FreeBSD on the desktop. I bet FreeBSD 12 will be truly great!

Note that it works much better on STABLE now than CURRENT because CURRENT is -well- not that stable…

So if you want to try this now, what you first need to do is to upgrade to the STABLE branch. For this you need to fetch the source, buildworld, buildkernel and installworld. Here is a very quick tuto (that you may need to adapt though). You can also find this here.


# Don't forget to upgrade RELEASE
# in any case that there were any bugs in the building tools.
freebsd-update fetch
freebsd-update install
reboot
freebsd-update install

# Replace the current source tree with STABLE.
mv /usr/src /usr/src-RELEASE
svn checkout svn://svn.freebsd.org/base/stable/11 /usr/src

# Build! Build! Build!
cd /usr/src
make buildworld -j4

# Customize (while you are at it) and build STABLE kernel.
cd /usr/src/sys/amd64/conf
cp GENERIC {YOUR-CONF}
vim {YOUR-CONF}
cd /usr/src
make buildkernel KERNCONF={YOUR-CONF}
make installkernel KERNCONF={YOUR-CONF}
reboot

# Now it's time to install world over the new kernel.
# In the meantime we also update configuration files
# with mergemaster.
mergemaster -p
cd /usr/src
make installworld
mergemaster -Ui
reboot

Now that your are on the latest STABLE, you can update the ports tree and install drm-next.


# Install ports tree if needed.
portsnap fetch
portsnap extract

# Install drm-next.
cd /usr/ports/graphics/drm-next-kmod
make install clean

Finally you must tell rc.conf to use the new i915 module instead. That is, add in /etc/rc.conf:


kld_list="/boot/modules/i915kms.ko"

Just one final reboot and you are done! Test this with the xorg and mesa-demos ports. Just startx from your user and check /var/log/Xorg.0.log to see if the intel driver was correctly loaded.

Intel NIC connection problem

PCIe ASPM is an hardware power management protocol for PCI express devices. It allows a far better power management than what can be done with software power management at the price of an increased latency to the device. However some hardware don’t advertise it properly. And this was in fact the origin of the power regression case of 2.6.38 which was later fixed in 3.3.

It may also cause some Intel NIC (such as e1000e) to fall asleep unintentionally. So if you have an Intel NIC on Linux and it even fails to acquire an IPv4 address then you might try to add this option to your kernel command line : pcie_aspm=off. On Debian you can add this option to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub and issue an update-grub.

You may also want to change the link-state of one specific device to L0/L1 at runtime. For this I’ll point you there : http://wireless.kernel.org/en/users/Documentation/ASPM.

Steam on Debian x86_64 (part 3)

Back again with news from Steam and Valve! So it seems that Valve plan to support other distributions after all. Anyway there has already been a lot of job done by the community to get Steam running on Debian (in particular). I used the following script to install Steam on Debian x86_64 with Awesome WM, Intel i7 and 8Go RAM (funny I got this script from an article of someone who did this with a similar configuration here):

http://kanotix.com/files/fix/install-steam-wheezy.sh

You need to launch this as root to install all dependencies and then again with a regular user to fetch the last version of glibc from the Ubuntu repositories. You could also use the experimental glibc from Debian but believe me experimental versions are somewhat… well… experimental.

Once everything is installed you may start Steam directly with the steam command. It will update itself and start again. It will also probably ask to install the jockey-common package. It’s an user interface and desktop integration driver management tool. But I didn’t installed it since there is no such package in the Debian repositories and even if I could I wouldn’t and Steam seems to launch cleanly without this anyway (notwithstanding a complaining message at each start). If you are using a tiling window manager be sure to put either Steam or your tag in float since some components don’t like it so much.

I did a first try with Team Fortress 2 (which is now no more listed as a beta) with a GeForce GTX 560 Ti. The games files will be installed by default in your home directory (~/.local/share/Steam/SteamApps) but you may change that easily. Once installed you may start the game from the Steam interface and believe what… It works !

Team Fortress 2 (Single-Player) on Linux

So the game runs very smoothly. I didn’t check the FPS against the Windows version but beside that the game loads faster. The same applies for Steam as well, actually everything loads a lot faster thanks to Linux. The first difference I noticed in the interface from the Windows version are the fonts. Also if you don’t have any sound while playing you might check this environment variable:

export SDL_AUDIODRIVER=pulseaudio

There are fewer sounds options than on Windows, only “2 Speakers” was available. The mouse seemed (perhaps it’s just an impression) less sensitive too. Although I’m sure you can tune Linux for a better gameplay. You may also easily change tag while playing which allows you to do a lot of other things at the same time. 

Spy among us

The two previous screenshot were games with bots. After that I also checked a game on Internet. No problem here either but a lot more fun. Again the game did run smoothly with no glitch and a network latency around 30 ms.

Ka-Boom!
Steady… Steady…
Apart from Team Fortress 2 other games are also available with Steam on Linux. For example here is a screenshot from X3 Reunion. What about Albion Prelude and X-Rebirth on Linux too ?
X3-Reunion on Linux (again)

A newcomer in the Linux Steam catalog is the beta for Half-Life (the first one). Although still marked as a beta the game is playable too. With the particularity that it also works on an Intel GMA card. That’s it no nvidia proprietary driver anymore !

Prepare for unforeseen consequences
System crash back in ’98

What more is the clients for other classic modifications of Half-Life are available but not listed in Steam. Some of them are somewhat playable. Opposing Force for example lack some models but CS:CZ instead did run perfectly. Blue Shift, DoD, Ricochet and TFC did not work at all. You should start those games directly with the hl_linux command as they are not listed in Steam:

$STEAM_LOCATION/SteamApps/common/Half-Life/hl_linux -game $GAME

 

You have spotted a friend
Opposing Force
Speaking of Half-Life modification I’d love to see Sven Co-op ported to Linux too. This was one of the best multiplayer mod for Half-Life. It had something we don’t find anymore in multiplayer games nowadays, too squared, adjusted, balanced and polished. Instead this game was raw and we had raw fun playing it! However I’d still love to hear about Half-Life 2, Garry’s Mod and Black Mesa Source on Linux too. Finally here is a video of Half-Life Beta on Linux with an Intel GMA card.

Steam on Debian x86_64 (part 2)

It seems that Valve games are on bad terms with Intel cards on Linux (which I fully understand), all I got when I first launched TF2 on my Thinkpad was a full black screen. But that black screen was nevertheless promising so I repeated the expriment on another machine with a GeForce GTX 560 Ti.

Running Team Fortress 2 on Linux

I managed to launch the game manually but it lacks some authentification mechanisms so I wasn’t able to start any game for now. Launching the game directly through steam doesn’t work probably due to an error in the launcher script which I have to dig into when I’ll have time.

Team Fortress 2 (fullscreen)
I wonder if I’d buy L4D2 to give it a try native games on Linux are neato ! Something else that did really amaze me was the relatively high CPU usage from the Steam client when idle. I may not yet be used to this waste of ressources we see in many (often proprietary) clients nowadays  and this is why I avoid them (I should post about this someday).

CD Key authentification invalid for internet servers.

There’s one thing I’d like to investigate is it possible to work on a free implementation of the Steam chat protocol ? I didn’t look into this at all but a Pidgin plugin would be very cool. Talking about Steam something that scares me though is the idea that only one well known distribution would actually be supported, a stance that we increasingly tend see in the matter of porting prorietary software to Linux but again Ubuntu is not Linux, far from it (I should post about this someday too) !