Optimus graphics on Arch Linux

in #linux6 years ago

What a fancy name. Optimus.

Well, if you don't know about it yet, it is the technology that powers the card switching technology for NVIDIA cards. Their cards are indeed more powerful than what the typical Intel graphics card can do, but also comes with a cost - they generate significantly more heat and consumes more energy. Hence, despite it is good to have them on laptops so you can play DOTA and do intense 3D editing on your laptop, it is not the best thing to keep it on 24/7 since it will affect the battery life drastically. By saying drastically, I mean a 3-hour vs 1-hour difference. You get that.

Optimus is the solution NVIDIA designed to solve this issue, your laptop intelligently switches over to the more powerful NVIDIA card when required (most probably playing games or do 3D simulations or things like that), and turns it off when it does not need it. Feels good? Of course, it is the reason why there's an NVIDIA card in my laptop. But here's the bad news, the tech is designed for Microsoft Windows. Oops.

This graphics switching thing can be considered as one of the most painful thing a Linux user can ever experience. I can go on forever listing the funny stuff when I was trying to get it working on Ubuntu distros and their derivatives like elementary OS...but here's a few.

  1. Graphical user interface does not load after installing the driver.
  2. Card cannot be turned off, even with NVIDIA's settings app.
  3. Visual artifacts all over the desktop after a suspend.
  4. Slower performance when not gaming. Wow.

Uh, yeah, it's indeed a little painful. That scene of Linus saying "F*ck you, Nvidia" always plays in my head whenever things like these happens. You can search that up on YouTube, although it's a pretty old clip and things seem to be changed, but the meme is still gold.

Normally, I don't think that I need to have NVIDIA graphics on Linux. I don't play games on it (well, I do, but RedEclipse is happy with my Intel card so I just ignore that), and I don't know how to do 3D stuff or anything like that. But, I learned it the hard way when I get a video assignment last year. Rendering videos with the Intel card is a total torture. You want a rating on a scale from 1 to 10? It's rendering things with 0.5 fps. <Insert painful emotes here>.

So, having NVIDIA graphics on my Linux partition is still kinda important...but how should I get it before it takes my brain to haywire mode?


To be honest, I was pretty reluctant to setup NVIDIA graphics on Arch Linux, because...it's Arch. It might be more painful than what I expect.

But I was bored so whatever let's try it out.

The Arch Wiki is like the most wonderful source of information I can find for Arch Linux, and yes it almost never failed me. The only time it did is...on an error which is caused by my broken mirror lists. Well, who breaks mirror lists anyway, it's pretty hard to do it accidentally...I don't even know how I did. But whatever, for this case it does have a page on Bumblebee, the piece of code used to bring Optimus to Linux systems.

Read about it here.

It comes with a very neat Install section telling you what you should do. Basically, run install commands, check if you deleted the required configuration files, add Bumblebee to the users group, and enable the service in systemd. That's not hard, and I'm expecting intense troubleshooting later on. That's how most tutorials on Bumblebee goes.

After a reboot...things worked.

I am actually pretty surprised that I can still run startx to get into my graphical user interface correctly. NVIDIA drivers didn't cause chaos this time? Wow.

Now let's see. By passing the app to optirun I can use the NVIDIA card to run it...

Intel card is used without optirun:
2018-07-14-012616_954x505_scrot.png

NVIDIA card is used with optirun:
2018-07-14-012640_954x505_scrot.png

glxgears with optirun:
2018-07-14-012843_1920x1080_scrot.png

Wew. That seems to be smoother than I expected! Although I found out that primus gives better performance and saves battery, it doesn't seem to work correctly on my laptop. Whatever, it's not like I will do video editing on battery power...optirun will still work fine enough for me. I'll just stick to that for now.


After reading a few more times, I get why I always fail to get Bumblebee working previously - I kept all those config files in the Xorg configuration folder. Not sure if this is the reason that caused this, but it is indeed mentioned in the wiki that I must remove it.

Again, self-reminder to read things more carefully before being slapped by errors. :P

See you next time!

--Lilacse

Sort:  

This post has been curated by TeamMalaysia Community :-

To support the growth of TeamMalaysia Follow our upvotes by using steemauto.com and follow trail of @myach

Vote TeamMalaysia witness bitrocker2020 using this link vote for witness

Coin Marketplace

STEEM 0.26
TRX 0.11
JST 0.033
BTC 63868.85
ETH 3063.91
USDT 1.00
SBD 4.10