You are not logged in.

#1 2015-01-24 05:41:11

Iris
Member
Registered: 2015-01-19
Posts: 6

Running nvidia-prime on Arch Linux

First and foremost, Hello!

I've installed Arch Linux on my system, I have a Nvidia Optimus based laptop, with an Intel GPU and a Nvidia GPU, the only way I can get to use that is using bumblebee, which is annoying, buggy and decreases performance, however, on Ubuntu 14.04, when I installed Nvidia drivers, it installed a package called nvidia-prime which embeds an options to choose which card to use in the Nvidia settings, I know that you can configure xorg.conf to use only the Nvidia card, but when I followed the wiki instructions, I get a black screen everytime, rendering my graphical user interface useless, I checked the xrandr but there are no ampersands, I have tried in all ways I found on the webs, but I could never get my PC to use my nvidia card only, however, using Ubuntu's nvidia-prime script, it just worked and worked wonderfully with high FPS, I have tried a couple options to install the .deb file on Arch Linux, but all fail or require methods I cannot really understand.

Source: https://launchpad.net/ubuntu/+source/nvidia-prime

What I tried:
    DPKG from the AUR, it failed.
    Using debtotargz, it gave me a "nvidia-prime_0.6.7_amd64.tar.xz" file, that I cannot

pacman -U

As I understand, writing a PKGBUILD file *should* be able to install the package, but I have no clue how I am supposed to go around writing that, the wiki was not of much help and I would really appreciate it if someone helps me get that package's functionality on Arch Linux, I am sure it would not just help me, but help everyone out there with such crappy laptops as mine.

Thank you for reading and thanks in advance for replying.
Iris

Offline

#2 2015-01-24 12:46:51

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: Running nvidia-prime on Arch Linux

Looking at the Launchpad page, they actually provide source code if you select the version, so you don't have to use debtotargz by the looks of things.

As for packaging it, I can have a look at it, but I think someone might create a PKGBUILD faster if this is moved to PKGBUILD Requests.

EDIT: You've seen this thread, right?

Last edited by clfarron4 (2015-01-24 12:57:10)


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#3 2015-01-24 17:43:31

Iris
Member
Registered: 2015-01-19
Posts: 6

Re: Running nvidia-prime on Arch Linux

clfarron4 wrote:

Looking at the Launchpad page, they actually provide source code if you select the version, so you don't have to use debtotargz by the looks of things.

As for packaging it, I can have a look at it, but I think someone might create a PKGBUILD faster if this is moved to PKGBUILD Requests.

EDIT: You've seen this thread, right?

I HAVE seen it, however, it was no help to me. I tried the steps described in the Arch Linux wiki, no help, black screen as usual.
I have not seen any "ports" in that thread.

Offline

#4 2015-01-27 07:59:15

Iris
Member
Registered: 2015-01-19
Posts: 6

Re: Running nvidia-prime on Arch Linux

So it cannot be done or what? O.o

Offline

#5 2015-01-27 11:38:02

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: Running nvidia-prime on Arch Linux

I honestly believe this should be moved to Package Requests and entrusted to someone that:

a) knows what they're doing PKGBUILDs;
b) has hardware to test the nvidia-prime scripts.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#6 2015-01-27 13:57:41

Iris
Member
Registered: 2015-01-19
Posts: 6

Re: Running nvidia-prime on Arch Linux

Ok, I have no problems with this being moved, I can test the PKGBUILDs, too.

Offline

#7 2015-01-27 15:19:39

AnAkkk
Member
Registered: 2014-03-03
Posts: 148

Re: Running nvidia-prime on Arch Linux

The nvidia-prime Ubuntu package is made to only work with LightDM, so if you aren't using LightDM it's not going to work.

Offline

#8 2015-01-27 16:50:32

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: Running nvidia-prime on Arch Linux

I have no idea if this PKGBUILD works, or even it meets the AUR Packinging standards. But I knocked this together:

# Maintainer: Claire Farron <diesal3[at]googlemail[dot]com>
pkgname=nvidia-prime
pkgver=0.7
pkgrel=1
pkgdesc="Tools to enable NVIDIA's Prime."
url="https://launchpad.net/ubuntu/+source/nvidia-prime"
arch=('x86_64' 'i686')
license=('GPLv3')
depends=('lightdm' 'bbswitch' 'python' 'bash')
optdepends=('nvidia' 'lightdm-gtk3-greeter')
makedepends=()
conflicts=()
replaces=()
backup=()
#install='nvidia-prime.install'
source=("https://launchpad.net/ubuntu/+archive/primary/+files/${pkgname}_${pkgver}.tar.gz")
sha256sums=('fb8216c07b2258113a84caf7fb945edd9694d238f3859deafb804d0df5d19ca4')

package() {
  cd "${srcdir}/${pkgname}"

  mkdir -p "${pkgdir}"/usr/{bin,lib/systemd/system}
  mkdir -p "${pkgdir}"/usr/share/{doc/nvidia-prime,nvidia-prime,lightdm/lightdm.conf.d}

  #Install PRIME
  install -m755 $srcdir/nvidia-prime/get-quirk-options $pkgdir/usr/bin/get-quirk-options
  install -m755 $srcdir/nvidia-prime/prime-offload $pkgdir/usr/bin/prime-offload
  install -m755 $srcdir/nvidia-prime/prime-select $pkgdir/usr/bin/prime-select
  install -m755 $srcdir/nvidia-prime/prime-supported $pkgdir/usr/bin/prime-supported
  install -m755 $srcdir/nvidia-prime/prime-switch $pkgdir/usr/bin/prime-switch

  #Add nvidia-prime-quirks
  install -m755 $srcdir/nvidia-prime/prime-quirks $pkgdir/usr/share/nvidia-prime/prime-quirks

  #Add systemD service
  install -m644 $srcdir/nvidia-prime/debian/nvidia-prime.service $pkgdir/usr/lib/systemd/system/nvidia-prime.service

  #Add LightDM
  install -m644 $srcdir/nvidia-prime/90-nvidia.conf $pkgdir/usr/share/lightdm/lightdm.conf.d/90-nvidia.conf

  #Other Information
  install -m644 $srcdir/nvidia-prime/debian/changelog $pkgdir/usr/share/doc/nvidia-prime/changelog.gz
  install -m644 $srcdir/nvidia-prime/debian/copyright $pkgdir/usr/share/doc/nvidia-prime/copyright
}

# vim:set ts=2 sw=2 et:

EDIT: As I understand it, this will get the package looking somewhat similar to the Ubuntu package. Whether anything actually runs is another matter.

EDIT2: Errors in PKGBUILD corrected. There is an EDIT3 coming.

EDIT3: If you don't want to build it yourself, here's a pre-built one on my Dropbox.

Last edited by clfarron4 (2015-01-27 17:25:52)


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

Board footer

Powered by FluxBB