AMD Radeon R9 270 experience in Fedora 23

Two years ago I purchased AMD Radeon R9 270 graphics card and wrote about my experience in Fedora 20 and also experience in Fedora 21 (Rawhide at that time). I decided to post an update to this, especially after recent news of AMD and Ubuntu deprecating fglrx (catalyst) proprietary driver.

Overall, I have to say the opensource radeon driver made huge progress in the last two years, and I don’t regret my purchase at all. Quite the opposite, I believe I’ve made the best choice possible by picking AMD. Basically everything I complained about in the past got fixed or improved. The dynamic power management works without a glitch. None of the X11 rendering operations are slow anymore. Support for vendor fan speed profiles has been implemented, so my card it now completely silent. All desktop rendering glitches went away a long time ago. The regular daily desktop usage is completely perfect and issue free, and actually noticeably superior even to current intel driver (which was known for its stability and reliability). The intel driver regressed a lot in the last 6 months or so, when developers started rewriting some core parts, while radeon driver remains completely bug-free in my experience.

The situation is of course more interesting when it comes to gaming. There were large quality and performance leaps in the radeon driver. The driver gained support for OpenGL 4.1 and higher versions of OpenGL are expected to be implemented in the next months. That itself fixed a lot of games which refused to run before. Performance also went up significantly. On Fedora 20/21 I complained that Dota 2 ran with 5-10 FPS on low settings. Now I can play it on ultra settings with 80 FPS. Of course this is an extreme example, but it shows that things really improved a lot. It also helps that Fedora is very active in packaging latest graphics driver stack and we usually run on a very recent version of the driver (compared to e.g. Ubuntu, which is quite conservative in this).

I won’t claim that everything it top-notch, though. There are still a few games that don’t run or don’t run well enough. The performance is also not yet up to the catalyst speed. But for a person like me, who owns many indie titles from various bundles, plays a few selected AAA titles from time to time, and can reboot to Windows in the absolutely worst case, is the current situation actually very good. And it seems to be improving constantly. The radeon driver development team is very responsive and if you write a reasonable request or a bug report, they really try to implement it or fix it (for example they implemented GPU-based display scaling on my request).

If you are interested which titles run on my Radeon R9 270 and how well, I made a profile on opengamebenchmarks.org and benchmarked most of my Steam library. You can have a look at my benchmarked games.

dota2-fps
FPS benchmark for Dota 2 on Radeon R9 270

As you can see, many even very graphics intensive games run quite well. For example Witcher 2 is infamous for how slow the Linux port is (it’s emulated by a proprietary wrapper similar to Wine), yet I can play it between 40-60 FPS depending on graphics detail. I was quite surprised.

If you are into gaming, I encourage you to submit your game benchmarks as well, so that we have an easy way to see how individual graphics and graphics vendors perform in games on Linux. I recently packaged voglperf and glxosd for Fedora, so it should be easy for your to install these benchmarking tools.

After considering all of this, I don’t really mind that AMD is deprecating catalyst. I understand that there are still use cases for catalyst, but most of the times the radeon driver is now a serious (and often better) alternative. If this means that AMD team will free up their hands from maintaining catalyst and will be able to put more people into radeon driver development (or the catalyst replacement which they plan to have on top of the opensource amdgpu kernel driver), it’s a good message for majority of Linux users.

AMD Radeon R9 270 experience in Fedora 23

glxosd and voglperf now available for Fedora in COPR

For all our gaming enthusiasts, I packaged glxosd and voglperf for Fedora and you can find them in my COPR repositories: glxosd COPR and voglperf COPR.

These tools allow you to have FRAPS-like features on Linux, i.e. show an overlay in OpenGL games/apps to display current FPS, and also capture the frame times into a file and plot them to a graph later. So you can now use it with any Linux game and fine-tune its graphics settings to match your preferred performance. Or you can see when your CPU or GPU is overheating. Or you can contribute to Open Game Benchmarks. Or something else.

This is an example of the glxosd overlay in action (don’t worry, its output is configurable):

glxosd-chivalry.png
glxosd overlay

And if you want, you can later plot the performance into such pretty graphs using this awesome glxosd analyser web page:

glxosdGraph-fps.png
fps graph
glxosdGraph-frametimes.png
frame times graph

And this is an example of the voglperf overlay (top left corner):

voglperf-xcom.png
voglperf overlay

And a generated graph:

voglperf-frametimes.png
frame times graph

There are other similar tools which you can use, but I know about any that is generic and has all these features. There is of course the Steam FPS overlay, but you can only use it for Steam games, and it can’t log frame information. There’s also GALLIUM_HUD, but that’s only available for Gallium-enabled drivers (radeon, nouveau) and also can’t log frame information. These two new tools should work with any driver and can be used for any game/app.

You can find installation instructions in the linked COPR repos. I do not intend to move these packages to official Fedora repos, but if somebody is willing to get their hands dirty and work on that, great, please contact me and I’ll try to help.

Enjoy!

Flattr this

glxosd and voglperf now available for Fedora in COPR

Fedora videos from DevConf 2016 now available

145px-devconf-cz_logo

Even if you’ve been to DevConf personally, you surely missed a lot of very interesting talks and workshops. All the videos are now available. Here are the Fedora related ones:

https://www.youtube.com/playlist?list=PLU1vS0speL2YytY0-1oxuNWXmfd1BHSd6

And here is the full list:

https://www.youtube.com/playlist?list=PLjT7F8YwQhr-Ox8LZY8VFrZHFkApOduBi

Enjoy!

Fedora videos from DevConf 2016 now available

Git Tip of the Day – viewing diffs graphically with meld

I got tired of viewing diffs in a terminal with red and green text. I wanted to see diffs more comfortably, with syntax highlighting, segment highlighting (not just full lines), easy scrolling, searching, switching between files. I wanted to have something like Phabricator diff, Netbeans diff or PyCharm diff. So I finally spent 20 minutes (why do most annoyances take you 20 minutes to solve, but you delay them for years?) and found out that git now has a cool new command, git difftool. And it supports meld, a great graphical comparison program.

Let’s compare this:

clidiff
git diff in gnome-terminal

With this:

meld1
meld diff overview
meld2
meld file diff

Awesome, right?!! All you need to do is this:

$ git difftool --tool=meld -d <diffspec>

Option -d makes it work in directory mode, which works much better with meld. Of course this is too long to type every time, to let’s remember meld as the default diff tool, and even make an alias for it:

$ git config --global diff.tool meld
$ git config --global alias.dt 'difftool -d'

(Also, don’t forget to enable syntax highlighting in meld preferences, it was disabled for me for some reason.)

And now, voila:

$ git dt master..develop

I’m very happy about the increased readability and productivity.

 

Flattr this

Git Tip of the Day – viewing diffs graphically with meld

GPU resolution scaling on external monitors with open source drivers

Linux seems to be finally becoming a viable gaming platform. That brings us into uncharted territories and we start to discover some deficiencies which were solved on other platforms a long time ago. One of those is GPU-based screen scaling.

What is GPU-based screen scaling?

If you want to display a non-native (lower) resolution on your monitor, you have several options how to do that:

  1. Center image – Display the image in the center using 1:1 pixel mapping (one pixel from the image is 1 pixel on the screen). Add black bars from all 4 sides to fill the rest of the screen. This produces smaller but perfectly sharp image.
  2. Scale image while keeping aspect ratio – Enlarge the image as much as possible, and (if the image has a different aspect ratio than the monitor) add black bars from the remaining 2 sides (usually top and bottom for movies, left and right for old games). This produces large but blurrier image.
  3. Scale image fully ignoring aspect ratio – Simply fill the whole screen. This produces full-sized, but blurrier and distorted image (e.g. text is stretched, human bodies have incorrect proportions, etc).

Some of this can be configured through your external monitor’s OSD menu. Centered image is usually not available, and aspect-based scaling is often available only for certain resolutions. Full scaling seems to be (sadly) both the default and the only option available in many cases. Because I’ve just recently bought a new monitor, I investigated a bit and even pricier monitors more often than not offer only the described limited set of options. That is of course unfortunate.

For that reason (and also to be able to configure scaling for fixed notebook screens), graphical drivers offer options to scale the image for you, any way you like. Instead of the monitor, the graphics card does it. This allows you to use any scaling mode that fits your purpose, not just those implemented by the manufacturer of your monitor.

Why do I need screen scaling?

I have described some reasons here. Usually it’s because of either old games (wrong aspect ratio) or too modern games (your hardware doesn’t keep up).

How can I configure GPU-based screen scaling?

For fixed notebook screens, you can do that through xrandr. See the properties of your monitor:

$ xrandr --prop
Screen 0: minimum 320 x 200, current 1920 x 1968, maximum 8192 x 8192
LVDS1 connected 1366x768+289+1200 (normal left inverted right x axis y axis) 277mm x 156mm
    <snip>
    BACKLIGHT: 11 
        range: (0, 15)
    Backlight: 11 
        range: (0, 15)
    scaling mode: Full aspect 
        supported: None, Full, Center, Full aspect
   1366x768      60.10*+
   1024x768      60.00  
   800x600       60.32    56.25  
   640x480       59.94

The default seems to be Full aspect. If you set None, it means the image should be sent unaltered into your monitor. You can configure different scaling like this:

$ xrandr --output LVDS1 --set "scaling mode" "Center"

This setting seems to be reset on machine reboot, and I haven’t investigated how to keep it permanent yet. Also, I tested this just on Intel, but I assume all drivers should support it.

For external monitors, I have a bad news for you – you can’t do it (yet). This is the deficiency I was talking about. The properties are not visible through xrandr. The proprietary AMD and NVIDIA drivers have supported it for a long time (example), but it seems there haven’t been enough demand in open source drivers yet (at least intel and radeon drivers can’t do it, I haven’t tested nouveau). So, I requested this functionality as Freedesktop bug 80868 and to my surprise there’s a tentative patch already (thanks Alex Deucher). If you’re skilled with C and hardware development, any help would be highly welcome. IIUIC, the patch will enable this functionality only for radeon driver – there will need to be a similar patch for intel (and possibly nouveau) driver.

 

Flattr this

GPU resolution scaling on external monitors with open source drivers

GALLIUM_HUD: FRAPS-like FPS overlay for Linux

I have long been looking for a simple way to display the current FPS in games (without direct support in the game), similar to what FRAPS or other tools do in Windows. For Linux, I haven’t had too much luck. There are not many tools for this and usually there are some problems with them – either they are not packaged and complication is difficult, or they don’t work reliably, or they can’t display FPS overlay in the game, just log to a file. But this weekend, I have finally been lucky.

I have stumbled upon an older article from Phoronix: Gallium3D Gets A Heads-Up Display For Information. Gallium3D is a graphics acceleration framework that is currently used by radeon and nouveau drivers. By simply setting an environment variable, you can get a live on-screen overlay displaying lots of useful information:

gallium-fraps

This is pretty amazing and it does exactly what I was looking for. The usage is really simple – to see the available options, just run:

$ GALLIUM_HUD="help" glxgears
Syntax: GALLIUM_HUD=name1[+name2][...][:value1][,nameI...][;nameJ...]

  Names are identifiers of data sources which will be drawn as graphs
  in panes. Multiple graphs can be drawn in the same pane.
  There can be multiple panes placed in rows and columns.

  '+' separates names which will share a pane.
  ':[value]' specifies the initial maximum value of the Y axis
             for the given pane.
  ',' creates a new pane below the last one.
  ';' creates a new pane at the top of the next column.

  Example: GALLIUM_HUD="cpu,fps;primitives-generated"

  Available names:
    fps
    cpu
    cpu0
    cpu1
    cpu2
    cpu3
    samples-passed

In Fedora 20, only basic options like fps and cpu are available. In Fedora Rawhide with newer graphics stack, there are many more options. But I’m fully content with just the basic ones. Now I can run games like this:

$ GALLIUM_HUD="fps,cpu+cpu0+cpu1+cpu2+cpu3:100" mygame

And I have pretty two graphs of FPS and CPU usage. You can run steam the same way, and then see the overlay on each game started from it. And, as a bonus, you can even run totem or vlc (with GL output) like this and see actual FPS of your video rendering:-)

I’m really excited about this. This is how I imagine a modern operating system to look like – useful features directly integrated into its core and very easily accessible (hell, it can’t get even easier than setting an environment variable!). Thanks Marek Olšák and AMD for implementing this. You really made my day.

The only drawback is that because it’s implemented in Gallium3D, it works only on Gallium3D-enabled drivers, which means opensource AMD and Nvidia drivers. No binary drivers and no Intel drivers can benefit from this. Marek explained that it had been very simple to implement this inside Gallium3D, but it would be very tricky to implement this on a level that would affect all the drivers. So there you have it, the opensource drivers now have a killer feature that proprietary drivers don’t:-) Just the Intel situation is unfortunate, maybe they’ll reconsider this some time in the future.

Enjoy.

Flattr this

GALLIUM_HUD: FRAPS-like FPS overlay for Linux

AMD Radeon R9 270 experience again, this time in Fedora Rawhide (21)

Last week I’ve written about my experience with AMD Radeon R9 270 card in Fedora 20. I have received much advice and feedback in the comments below and some people nudged me to try the latest opensource driver (it’s been a month since Fedora 20 release and OSS world clearly moves fast). So that’s what I did. This post is a follow-up to the previous one, just containing information about the latest changes in the RadeonSI driver. I haven’t tested Catalyst, because I already covered the latest version in the previous article and I don’t expect any major changes just by changing Fedora version.

I did all my testing on Fedora Rawhide (to be Fedora 21 in a distant future). In order to get newer OpenGL support, I used llvm 3.4 packages – those are not yet pushed to Rawhide’s repository, but they should be hopefully merged soon and are available in a special build tag for the moment. I used mesa git 2014-01-10, xorg-x11-drv-ati git 2014-01-12 and xorg-x11-glamor git 2014-01-15 (including a patch for faster gtk lines drawing) – all of this compiled on a machine with llvm 3.4. I was running on nodebug kernel 3.13 rc8 (beware of my mistakes). Packages for S3TC compression (libtxc_dxtn) were installed.

The changes in RadeonSI since Fedora 20

These are the major changes that I spotted in the short time:

  • Dynamic power management is enabled automatically. You no longer need to adjust the kernel command line, the card scales its speed according to the load automatically. This is brought by kernel 3.13. One less thing to care about, great.
  • GTK primitives rendering is much faster. The developers were very active in addressing the issue and provided several patches. They are not yet committed into the main branch, but one of them is now even included in Fedora packages by default. The rendering speed is not yet on par with other drivers (as you can see in the tests below), but it’s at least an order of magnitude faster. I have no problems with LibreOffice Calc or Motif-like GUIs anymore, everything runs perfectly. Many thanks to radeonsi developers.
  • You’ll get OpenGL 3.1/3.0 version support instead of OpenGL 2.1. This is great news, because it allows more games to run, especially the commercial ones. There’s still a long way to go to the current OpenGL 4.4 specification, but this helps with compatibility a lot.
  • There are some desktop rendering glitches. I’ve seen a small rendering issues with message tray icons in GNOME. Some of the icons sometimes became invisible (totally transparent). You could still click on them, but you could not see them. I’ve also seen others report this problem, so I assume it’s known and hopefully will be fixed soon. I haven’t seen this problem back on Fedora 20. There are also some other minor glitches, for example very occasionally there is a graphical artifact instead of some letter rendered on the web by Firefox. But that is very rare, can be fixed by highlighting the text and happens on Fedora 20 as well.
    Update: The invisible icon bug seems to have been fixed the next day after I published this. I still see some issues, but they are most probably related to GNOME in general and not to radeonsi driver.

In general I’ve been very pleased by the recent development, the developers are responsive and they have improved the driver a lot recently.

Gaming

I have some good news and some bad news. The good news is that the number of games that run and their performance have improved substantially. And I mean substantially. On Fedora 20 half of my Steam games crashed or there were some serious issues with them. Now only 10% crash (some of that might be caused by llvm 3.4, according to the crash messages) and another 15% are either slower or experience graphical issue. However, the majority now runs just fine.  I attribute this mainly to the OpenGL 3.1/3.0 support. Here’s my updated list of Steam games I tested, compare Fedora 20 RadeonSI column with Fedora Rawhide RadeonSI column:

Game compatibility list
Game compatibility list

Performance-wise there have been some improvements as well, probably at around 10% or so in average. You can see the updated Phoronix Test Suite graphs below. The commercial games felt a bit better as well.

Phoronix Test Suite benchmark results

The bad news is that we’re still not there. The situation improved sharply, but there’s still a large percentage of games which can’t be played. The performance also varies wildly. For example Dota 2 was totally unplayable even with low quality settings, you could see 5-10 FPS easily in larger battles. On the other hand, Left 4 Dead 2 or Team Fortress 2 seemed very well playable (I spent max 5-10 minutes in these games, so the real gameplay results might vary).

Conclusion

If you want to play on Linux with an AMD graphics card and an opensource driver, you still need to be a modest gamer. You must not mind if some of your games run very slow or not at all. However, the recent progress has been very good and it seems that AMD together with community developers try real hard to provide a fully functional opensource driver. I’m very glad for that. Hopefully Linux users won’t need to choose between freedom (plus out-of-the-box functionality) and performance in the near future. By the way, I decided to keep the AMD card in order to support OSS-compatible companies.

Update: I have written a follow-up with my experiences from Fedora 23.

Flattr this

AMD Radeon R9 270 experience again, this time in Fedora Rawhide (21)