[Sticky] A script to change Xorg config  

Page 1 / 2 Next
  RSS

Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
November 15, 2018 10:46 am  

Hey all!

For many users, eGPU is less than plug and play. In my case, I already have two internal GPU's, and have to fiddle with Xorg configs some way or another, and it's a pick and choose. You can have the onboard (either the integrated or the discrete) GPU render the laptop screen and have the eGPU render an external screen, or you can have the eGPU render both, or something else of your choosing, but not dynamically, sadly.

The way I've solved it is to have an Xorg config that makes the eGPU render both the laptop screen and any external screen(s) that may be connected and when I want to use the eGPU, I have:
https://github.com/karli-sjoberg/gswitch/blob/master/xorg.conf.egpu

And then create a symbolic link to /etc/X11/xorg.conf, plug in the eGPU, reboot and done. But after a while, the manual steps started to bore me and remembered the old saying: "One time is none. Two times is a script!"
https://github.com/karli-sjoberg/gswitch

And then I got a "little" carried away and wanted to learn how to write QT GUI applications 🙂 Thing is, I can´t learn just by reading the documentation and look at examples, I have to have "a mission" to set out on and this was the perfect task to get me going!
https://github.com/karli-sjoberg/gswitch-gui

And then I wanted to make the installation process even easier for new users, so I invested some time to learn how to make .deb packages out of the binaries:
https://github.com/karli-sjoberg/gswitch-deb
https://github.com/karli-sjoberg/gswitch-gui-deb
So you can clone, edit and then build these packages yourselves! I have setup a PPA for this to make the process as easy as humanly possible!

Here's how to set it up:

sudo add-apt-repository ppa:karli.sjoberg/gswitch-ppa
sudo apt-get update
sudo apt-get install -y gswitch-gui

Then you need to check what PCI BusID the eGPU gets _after_ plugging it in to the laptop:

# nvidia-xconfig --query-gpu-info | grep -i -A 3 '1080ti' | awk '/PCI BusID/{print$4}'

If you are happy with the output, we store it in a variable and edit the xorg template:

# BUS_ID=$(nvidia-xconfig --query-gpu-info | grep -i -A 3 '1080ti' | awk '/PCI BusID/{print$4}')
# sudo sed -E -i "s/BusID.*$/BusID \"${BUS_ID}\"/" /etc/X11/xorg.conf.egpu

After that you´re all set! When you want to use the eGPU, you just run:

# sudo gswitch egpu

The laptop will reload the screen, so make sure to save everything open before doing so! And when you´re done, you run:

# sudo gswitch internal

It will reload and you can disconnect the eGPU.

Or if you´d rather want to use the GUI, open your applications menu and look under System 😉

Hope it helps!

PS. Right now, this script and xorg template is only written for nvidia-based cards, since the driver listed in the template is "nvidia" and the script doesn´t try to manage that. If you have a AMD card, or if you have something you feel could be done better, we can discuss the changes here, then for the actual code, pull requests are warmly welcome!

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


theitsage liked
ReplyQuote
theitsage
(@itsage)
Famed Member Admin
Joined: 2 years ago
Posts: 3228
November 15, 2018 2:54 pm  

@sebulon Welcome aboard and thank you for sharing this script! To clarify we only need to change the driver identification and BusID to replicate your success? I'm using an Alienware 15 R3 that has Intel iGPU running the internal display, nVidia dGPU that doesn't seem to do anything, and AMD eGPU that can work with internal display mode (DRI_PRIME=1) but has absolutely no external monitor output.

Best ultrabooks for eGPU use

eGPU enclosure buying guide

86 external GPU build guides


ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
November 15, 2018 3:40 pm  

Thanks man, appreciate it!

Well, I can't say for sure, no guarantees. It's Hippie, right? 🙂 But in theory, yeah, should be.

Prime is something new to me, could you explain how to use it?

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


theitsage liked
ReplyQuote
theitsage
(@itsage)
Famed Member Admin
Joined: 2 years ago
Posts: 3228
November 15, 2018 3:51 pm  

I'm a novice so I simply followed the instructions posted in this Linux sub forum. To get my AW15R3 use the eGPU I put Prime string in front of whichever software I want to run. For example, I run Unigine Valley with DRI_PRIME=1 ./valley. This works well so far but I'd like to get external monitor output and have a better control over which GPU is doing what.

Best ultrabooks for eGPU use

eGPU enclosure buying guide

86 external GPU build guides


ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
November 15, 2018 4:01 pm  

Ah, OK, seems easy enough 🙂 

Going to try it that tonight and see how it goes. Wonder how that goes with processes that starts other processes... Like you start steam; that gets rendered with the eGPU, but what about when I start a game from it, does it inherit, or does it default? I'll report back when it's tested!

And about the "BusID", remember to convert from hex to decimal. Maybe you already knew that but it's worth mentioning

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
November 15, 2018 7:52 pm  

Neh, Prime did not work for me, it renders on the built-in Quadro in my Lenovo P50, looks like this:

$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM107GLM [Quadro M1000M] (rev a2)
0a:00.0 VGA compatible controller: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] (rev a1)
$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x29a cap: 0x1, Source Output crtcs: 4 outputs: 6 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x43 cap: 0x6, Sink Output, Source Offload crtcs: 3 outputs: 1 associated providers: 1 name:modesetting
$ DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Quadro M1000M/PCIe/SSE2
$ DRI_PRIME=0 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Quadro M1000M/PCIe/SSE2

So I guess the time spent scripting pays off, at least 🙂 Could you run the commands and share the output, just for comparisons sake?

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


theitsage liked
ReplyQuote
theitsage
(@itsage)
Famed Member Admin
Joined: 2 years ago
Posts: 3228
November 15, 2018 8:00 pm  

Thank you for testing it with your setup. I will get the output and post them tonight on my AW15R3 + eGPU.

Best ultrabooks for eGPU use

eGPU enclosure buying guide

86 external GPU build guides


ReplyQuote
theitsage
(@itsage)
Famed Member Admin
Joined: 2 years ago
Posts: 3228
November 15, 2018 10:56 pm  

Here's my output:

$ lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation GP104BM [GeForce GTX 1070 Mobile] (rev a1)
09:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Vega 10 XT [Radeon PRO WX 9100]
$ xrandr --listproviders
Providers: number : 0
$ DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Radeon(TM) Pro WX9100 (VEGA10, DRM 3.26.0, 4.18.17-300.fc29.x86_64, LLVM 7.0.0)
$ DRI_PRIME=0 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: NV134

Best ultrabooks for eGPU use

eGPU enclosure buying guide

86 external GPU build guides


ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 8 months ago
Posts: 75
November 16, 2018 2:28 am  

@itsage

Seeing that output, I think your problem is that the WX cards are (to the best of my knowledge) only supported by the AMDGPU-PRO driver and not the open source amdgpu driver. And to make things even more confusing, note that you might not be able to install the AMDGPU-PRO driver on your existing OS, only Ubuntu 16.04.

You could try going with a different card, maybe an nvidia one since @sebulon seems to have gotten nvidia eGPU+dGPU working.

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460 (AKiTiO Node)
+ macOS 10.14.1+Win10
+ Linux Mint 19


theitsage liked
ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
November 16, 2018 6:00 pm  

Looks supported to me:
https://www.amd.com/en/support/kb/release-notes/rn-prorad-lin-18-30

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


theitsage liked
ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 8 months ago
Posts: 75
November 16, 2018 6:56 pm  

That list is referring to the package with both the AMDGPU and AMDGPU-PRO drivers as it says just above on that page. Maybe the WX cards aren't unsupported with the open source driver only but I think they're clearly intended to be used with both the AMDGPU and AMDGPU-PRO drivers from the package on that page.

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460 (AKiTiO Node)
+ macOS 10.14.1+Win10
+ Linux Mint 19


ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 8 months ago
Posts: 75
November 16, 2018 7:09 pm  

From the install overview:

  • Pro: recommended for use with Radeon Pro graphics products.

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460 (AKiTiO Node)
+ macOS 10.14.1+Win10
+ Linux Mint 19


ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
November 18, 2018 2:21 pm  

@nu_ninja

I agree it's a tricky question, but reading the man page for amdgpu says:
"The amdgpu driver supports SI and newer families' video cards."

"SI" supposedly stands for Southern Islands, which looking at this wiki-page covers just about every card after AMD bought ATI:
https://en.wikipedia.org/wiki/List_of_AMD_graphics_processing_units

How I interpret this, is if something's *not* working as intended with the open source amdgpu driver, a bug-report is in order. Because it should "just work".

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
mzo
 mzo
(@mzo)
Active Member
Joined: 2 years ago
Posts: 13
November 22, 2018 6:31 am  

 

 
Hi, I’m planning to try your solution above in order to use my eGPU to render the laptop screen. I also have a iGPU + dGPU configuration. My late 2016 MacBook pro 13,3 (15 inch w Touch Bar) is setup as tri-boot with macOS HS, win 10 and Ubuntu 18.10 with kernel 4.19. I have an eGPU Nvidia 1080ti with Akitio thunder 3 mod’ed. For now I’ve been using the eGPU with MacOS and Win10. I’m now trying to set this up under Linux.

 

I have a question about what drivers to use. At the moment I’m using the open source ppa by Oibaf to keep amdgpu updated. But on top of that I also installed another ppa (graphics drivers ppa) that uses proprietary Nvidia drivers. In this way, when I connect the egpu it is now recognized while with the Oibaf ppa alone  (that uses nouveau drivers for Nvidia) the egpu wasn’t recognized. However, now both open source and proprietary Nvidia drivers are in the system and I believe they are causing conflicts.

 

The point of using Oibaf ppa is that amdgpu seems more stable with that driver than with the Ubuntu standard. However, my goal would be to configure Xorg so that: if eGPU is not present, then use iGPU only. If eGPU is present, then use it exclusively while the other two GPUs are disabled. So dGPU would always be disabled, while I will choose if booting with iGPU or eGPU as primary card depending on what software I’m planning to run on that session.

 

In order to achieve that, how would edit the Xorg conf file? Once edited will I still be able to use your script to automate the switch?

 

Finally, what drivers shall I use? The idea would be to purge Oibaf ppa and use standard Ubuntu drivers for the iGPU and proprietary Nvidia drivers for eGPU. Is this the right way to go?

Thank you

 
 
 

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
November 22, 2018 7:59 am  

Hey man!

I´m by no stretch an expert, I just shared what worked for me, and _may_ work for others, no guarantees!

I think your plan sounds sane, like what I do. I have added the graphics drivers PPA from here, perhaps the same one you have:
https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa

And installed the 410 version of the nvidia driver. Not sure if that was really needed but it´s done.

If I had an AMD card, I would´ve stuck with the driver that comes with the distro, as that seems to be reasonably up to date and more importantly supported and integrated with it. Adding unsupported PPA's is something I´m extremely weary of, since it may or may not break stuff down the line when the PPA maintainer finds another fancy or get hit by a bus, or whatever. I want my machine to be rock friggin solid. I´m too boring to sit and tinker with stuff now. I´ve grown past that learning part of my life when something like Arch would have been cool. Nowadays, I know how that stuff works, I concede to the wisdom of the distro's package maintainers (that mostly get stuff done "right" anyways) and just want to sit down and game or whatever 🙂 I have my FreeBSD servers to play with 🙂

You can use my xorg config just like it is, no additional config lines are necessary when using any Ubuntu derivative. Just make sure to change the "BusID" accordingly and use my script when you want to switch the graphics to the eGPU and back. Do you know how to get that going or do I need to explain in more detail?

HIH

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
mzo
 mzo
(@mzo)
Active Member
Joined: 2 years ago
Posts: 13
November 22, 2018 8:28 am  

Hi again, thanks for clarifying about drivers. Regarding the Xorg.conf and the script, yes if you could provide more details that would be great as I’m pretty new to Linux. 

In particular, I understand the I can use your Xorg.conf.egpu variation for using the egpu. But what about the regular Xorg.conf file to load the iGPU? At the moment, I don’t have any Xorg configuration file. In fact, the kernel loads up the dGPU (which I don’t want because runs too hot and tends to crash the system). So how should my standard Xorg.conf look like in order to load the iGPU only, when Im not using xorg.conf.egpu to load the egpu? Thanks so much.

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
November 22, 2018 9:52 am  

That´s quite alright, I figured as much 🙂

You don´t need any xorg.conf when you don´t want to use the eGPU, that´s what´s good about it. Regarding the dGPU, what you´re asking is how to disable it completely; that I don´t know. But that´s not how these things work either. In PC's, you can in BIOS/UEFI choose like "Hybrid Graphics" or "Discrete Graphics". Hybrid _enables_ both i- and d-GPU and then you just _use_ the iGPU and let the dGPU be, and that´s what you´ll be doing. You will not _use_ the i/d-GPU when you plug in the eGPU (after running the script), but they will be enabled. That´s the difference. Hope I explained that so it makes sense...

Since you´re a beginner. I´ve scripted the process for you to minimize the potential error:

# wget  https://raw.githubusercontent.com/karli-sjoberg/egpu/master/gswitch_setup.sh  -O gswitch_setup.sh
# chmod +x gswitch_setup.sh
# sudo ./gswitch_setup.sh

Then you need to check what PCI BusID the eGPU gets _after_ plugging it in to the laptop:

# nvidia-xconfig --query-gpu-info | grep -i -A 3 '1080ti' | awk '/PCI BusID/{print$4}'

If you are happy with the output, we store it in a variable and edit the xorg template:

# BUS_ID=$(nvidia-xconfig --query-gpu-info | grep -i -A 3 '1080ti' | awk '/PCI BusID/{print$4}')
# sudo sed -E -i "s/BusID.*$/BusID          \"${BUS_ID}\"/" /etc/X11/xorg.conf.egpu

After that you´re all set! When you want to use the eGPU, you just run:

# sudo gswitch egpu

The laptop will reboot, so make sure to save everything open before doing so! And when you´re done, you run:

# sudo gswitch internal

It will reboot and you can disconnect the eGPU. Simple as that.

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


theitsage liked
ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
November 22, 2018 9:54 am  

I should probably edit the top post, since scripting is a lot less error prone, but I´ll let you be cannon fodder first, haha 😀

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
mzo
 mzo
(@mzo)
Active Member
Joined: 2 years ago
Posts: 13
November 22, 2018 5:54 pm  

@sebulon

Thank you so much! I’m going to try this over the weekend. I’ll let you know how it goes.

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
Morv
 Morv
(@morv)
Eminent Member
Joined: 2 years ago
Posts: 33
November 23, 2018 12:04 pm  

I tested your script last evening on Arch Linux and a HP Omen Graphics Accelerator. I didn't want to reboot so I thought that I basically just need to restart the XServer and this is done by restarting your display manager. So I replaced every "reboot" with a "`systemctl restart lightdm`" and it worked, kind of. It's interesting because I get all the monitors connected to my eGPU displayed and usable but they're fired by the Intel iGPU which is apparently too weak for FullHD + 2x WQHD or it's just the Plasma desktop being slow. The inserted AMD gpu is not used at all, tried with glxspheres64 on one external monitor.

What I would like to ask you, as your script is working for you otherwise: Could you do the same to the script(insert your displaymanager of course) and test what the outcome is for you? I didn't get to try the reboot method yet because I have to manually authorize the eGPU after connecting and ran out of time yesterday. Will try that probably this evening or some time over the weekend.

Edit: Ok, the reboot method doesn't change a thing. So restarting the display manager should be enough but my config doesn't fit the setup apparently.

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


theitsage liked
ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 8 months ago
Posts: 75
November 23, 2018 7:08 pm  

@morv

I believe the script was written with nvidia in mind, so change 'nvidia' to 'amdgpu' in the xorg.conf.egpu file and that should work.

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460 (AKiTiO Node)
+ macOS 10.14.1+Win10
+ Linux Mint 19


ReplyQuote
Morv
 Morv
(@morv)
Eminent Member
Joined: 2 years ago
Posts: 33
November 23, 2018 8:15 pm  

@nu_ninja I know that and set the driver accordingly, should've mentioned it probably. The GPU is also recognized and listed by lspci, also the amdgpu driver module is loaded even without the xorg.conf.egpu being renamed by the script.

I'm on kernel 4.19.2.

Edit: Ok, got it to work by moving the config to /etc/X11/xorg.conf.d/ where all the other configs are put. Now the displays are driven by the external gpu, will modify the script towards this 🙂 I have basically no relevant knowledge about all the configs, so maybe this is a thing the way Arch Linux is set up? Restarting the display manager is enough though! This reduces the amount of time a lot for switching between external and internal GPUs.

Edit2:
This is my change to the script, switched several times now, works surprisingly fine. Wouldn't have thought to get the eGPU running that fast. Thanks a lot for the starting point @Sebulon.

#!/bin/sh

if [ $(whoami) != "root" ]; then
 echo "You need to be root."
 exit
fi

if [ "${1}" = "egpu" ]; then
  if [ -h /etc/X11/xorg.conf.d/10-amdegpu.conf ] && \
     [ -f /etc/X11/xorg.conf.d/10-amdegpu.conf.egpu ] && \
     [ "$(readlink /etc/X11/xorg.conf.d/10-amdegpu.conf)" = "/etc/X11/xorg.conf.d/10-amdegpu.conf.egpu" ]; then
    echo -n "You are already set up. Would you like to relog now? (Y/n): "
    read ANSWER
    case ${ANSWER} in
      Y|y|Yes|yes)
        `systemctl restart sddm`
      ;;
      N|n|No|no)
        exit 0
      ;;
      *)
        echo "Unknown argument: ${ANSWER}."
        exit 1
      ;;
    esac
  else
    ln -s /etc/X11/xorg.conf.d/10-amdegpu.conf.egpu /etc/X11/xorg.conf.d/10-amdegpu.conf
    `systemctl restart sddm`
  fi
elif [ "${1}" = "internal" ]; then
  if [ -h /etc/X11/xorg.conf.d/10-amdegpu.conf ] && \
     [ -f /etc/X11/xorg.conf.d/10-amdegpu.conf.egpu ] && \
     [ "$(readlink /etc/X11/xorg.conf.d/10-amdegpu.conf)" = "/etc/X11/xorg.conf.d/10-amdegpu.conf.egpu" ]; then 
    rm -f /etc/X11/xorg.conf.d/10-amdegpu.conf
    `systemctl restart sddm`
  else
    echo -n "You are already set up. Would you like to relog now? (Y/n): "
    read ANSWER
    case ${ANSWER} in
      Y|y|Yes|yes)
        `systemctl restart sddm`
      ;;
      N|n|No|no)
        exit 0
      ;;
      *)
        echo "Unknown argument: ${ANSWER}."
        exit 1
      ;;
    esac
  fi
else
  echo "Unknown argument: ${1}."
  echo "Valid arguments are \"egpu\" or \"internal\"."
  exit 1
fi

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


theitsage and nu_ninja liked
ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
November 24, 2018 10:28 am  

@Morv

I really dig your changes, I'm going to test them out and see what changes. About the authorizing part, I was just too lazy to do it every time so I've put this into udev:
/etc/udev/rules.d/99-local.rules

ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1"

So it just authorizes everything that's plugged in, while I wait for the KDE team to fix Bolt into Plasma. Nice choice of desktop by the way 😉 Rocking KDE Neon myself.

Now, about the changes you made, can we have that conversation up on GitHub instead, and push the changes there, so it gets tracked, please? I'm not a fan of Git myself but this is a conversation worth having!

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


Morv and theitsage liked
ReplyQuote
theitsage
(@itsage)
Famed Member Admin
Joined: 2 years ago
Posts: 3228
November 24, 2018 8:22 pm  

Thank you all for making this process easier in Linux!

Best ultrabooks for eGPU use

eGPU enclosure buying guide

86 external GPU build guides


ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
November 27, 2018 8:54 am  

Huuuge update! The script now has a full fledged GUI frontend! Top post updated! 🙂

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


theitsage liked
ReplyQuote
theitsage
(@itsage)
Famed Member Admin
Joined: 2 years ago
Posts: 3228
November 27, 2018 8:24 pm  
Posted by: Sebulon

Huuuge update! The script now has a full fledged GUI frontend! Top post updated! 🙂

Thank you very much! I will give it a try soon and report back.

Best ultrabooks for eGPU use

eGPU enclosure buying guide

86 external GPU build guides


ReplyQuote
mzo
 mzo
(@mzo)
Active Member
Joined: 2 years ago
Posts: 13
November 27, 2018 9:48 pm  

@Sebulon

Great stuff, thank you.

I'm sort of stuck at  " BUS_ID=$(nvidia-xconfig --query-gpu-info | grep -i -A 3 '1080ti' | awk '/PCI BusID/{print$4}')" as  nvidia-xconfig returns that cannot provide GPU info. There I understood that the Nvidia drivers are not working. The eGPU is recognized OK and can get the bus id from " lswh -c video " but it appears that the open-source Nouveau drivers that come with Ubuntu are preventing the proprietary Nvidia drivers that I installed from " ppa:graphics-drivers/ppa " from working (although they appear installed OK). I read somewhere that Nouveau drivers need to be blacklisted to prevent this kind of problems. Do You have any advices about this? Shall I download the drivers directly from Nvidia and go through manual installation? How do I block the pre-installed Nouveau and prevent them from creating conflicts?

Thanks again

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
November 27, 2018 9:56 pm  

Hey @mzo!

Can you just run the command:

# nvidia-xconfig --query-gpu-info

And paste the output here, please?

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
mzo
 mzo
(@mzo)
Active Member
Joined: 2 years ago
Posts: 13
November 28, 2018 1:32 am  

Hi @Sebulon,

The output is: "ERROR: Unable to query GPU information"

 

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
November 30, 2018 9:57 am  
Posted by: mzo

Hi @Sebulon,

The output is: "ERROR: Unable to query GPU information"

Hi @mzo!

I was able to reproduce your issue and have a solution _that works for me_! I'm not sure if the mainline kernel is actually needed, maybe just purging everything related to nvidia is enough, but this is how I did it.

Note here that the order _is_ important! Install the mainline kernel first, then make sure to purge everything related to "nvidia", then install the latest driver again.

wget  http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/linux-headers-4.19.0-041900_4.19.0-041900.201810221809_all.deb 
wget  http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/linux-headers-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb 
wget  http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/linux-image-unsigned-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb 
wget  http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/linux-modules-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb 
sudo dpkg -i linux-headers-4.19.0-041900_4.19.0-041900.201810221809_all.deb
sudo dpkg -i linux-headers-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb
sudo dpkg -i linux-modules-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb
sudo dpkg -i linux-image-unsigned-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb
rm -f linux-headers-4.19.0-041900_4.19.0-041900.201810221809_all.deb
rm -f linux-headers-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb
rm -f linux-modules-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb
rm -f linux-image-unsigned-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb
dpkg --list | awk '/nvidia/{print$2}' | xargs sudo apt-get purge -y
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install -y nvidia-driver-410
reboot

And to uninstall everything, if you're not satisfied:

sudo dpkg -P linux-image-unsigned-4.19.0-041900-generic
sudo dpkg -P linux-modules-4.19.0-041900-generic
sudo dpkg -P linux-headers-4.19.0-041900-generic
sudo dpkg -P linux-headers-4.19.0-041900
dpkg --list | awk '/nvidia/{print$2}' | xargs sudo apt-get purge -y
sudo add-apt-repository --remove ppa:graphics-drivers/ppa
reboot

I'm not sure if the mainline kernel is actually neccessary, but as I said, this works for me. Hope this solves the issue with "nvidia-xconfig" for you as well.

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 8 months ago
Posts: 75
November 30, 2018 10:25 pm  

Thanks for the work @sebulon the gswitch package works for me (I just changed the driver and busID manually in xorg.conf.egpu since I'm using an AMD card).
When I download and try to unpack the gswitch-gui package however, I get a dependency error:

Looks like the qt5 version on Linux Mint is a bit out of date:

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460 (AKiTiO Node)
+ macOS 10.14.1+Win10
+ Linux Mint 19


ReplyQuote
mzo
 mzo
(@mzo)
Active Member
Joined: 2 years ago
Posts: 13
December 1, 2018 8:07 am  
 
Thank you so much for this, I’m going to try this on Monday.
 
In the last couple of days I actually tried many things to solve my issues, including a process very similar to the one you are describing.
 
I purged Nvidia-* then I installed the latest mainline kernel using the script ubuntu-mainline-kernel.sh and reinstalled nvidia-driver-410 (also tried 415). No luck so far. I think this way was almost identical to the one you suggested however I’ll try your way as well to see if installing the mainline kernel manually makes a difference.
 
I have been having troubles blacklisting the nouveau drivers. I did it in /etc/modprobe.d/blacklist.conf and also on grub adding nouveau.modeset=0 after quite splash. This does not seem to work as nouveau keeps getting listed. I think this may a possible cause of the problem. Do you have any advices about this?
 
Yesterday at some point I was messing around with xorg and the nvidia driver suddenly loaded (nvidia-settings returned the driver and gpu info) but unfortunately this was during a sequence of actions and after reboot it stopped working again. I was unable to isolate and reproduce the step that made it work.
 
A couple of questions, do I have to stop the video server and install the nvidia driver from command line?  Does the eGPU need to be connected at all times during the nvidia driver installation?
 
Thank you.
 
 

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
December 1, 2018 8:28 am  
Posted by: mzo
I have been having troubles blacklisting the nouveau drivers. I did it in /etc/modprobe.d/blacklist.conf and also on grub adding nouveau.modeset=0 after quite splash. This does not seem to work as nouveau keeps getting listed. I think this may a possible cause of the problem. Do you have any advices about this?

Installing the nvidia drivers does that automatically, so no need actually:

# dpkg -L nvidia-kernel-common-410
...
/lib/modprobe.d/nvidia-graphics-drivers.conf
...
# cat /lib/modprobe.d/nvidia-graphics-drivers.conf
blacklist nouveau
blacklist lbm-nouveau
alias nouveau off
alias lbm-nouveau off
Posted by: mzo
A couple of questions, do I have to stop the video server and install the nvidia driver from command line? Does the eGPU need to be connected at all times during the nvidia driver installation?

No and maybe, I don't know 🙂

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
Sebulon
(@sebulon)
Active Member
Joined: 4 weeks ago
Posts: 18
December 1, 2018 8:49 am  
Posted by: Sebulon

Adding unsupported PPA's is something I´m extremely weary of, since it may or may not break stuff down the line when the PPA maintainer finds another fancy or get hit by a bus, or whatever.

I realize how self-contradictory this is going to sound... But I've setup a PPA 🙂

Tested on Ubuntu Standard 18.04, Kubuntu 18.04 AND Linux Mint 19 😉 Top post updated.

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


nu_ninja liked
ReplyQuote
mzo
 mzo
(@mzo)
Active Member
Joined: 2 years ago
Posts: 13
December 6, 2018 12:25 am  

@sebulon

Hi, I installed your ppa but the installation returns an error saying that this ppa does not have a release file so it cannot be securely updated.

Now, every time I sudo apt-get update the system I get that error.

I tried to remove the ppa with ppa-purge but it won’t let me to because of the same error above.

Any idea how can I fix this? Also, as an alternative, can the script still be installed manually?

Thanks

Soon I will add my system & eGPU details or a build link to this my signature to give context to my posts


ReplyQuote
nu_ninja
(@nu_ninja)
Trusted Member
Joined: 8 months ago
Posts: 75
December 6, 2018 3:26 am  

@mzo

You can manually change the sources apt uses by just editing the file:

/etc/apt/sources.list 

so you could edit that to remove the PPA or I think you can add allow-insecure=yes in brackets [  ] after deb in the line with the gswitch PPA and that might fix it.

Edit: Looking at my directory, the list file might also be in /etc/apt/sources.list.d/

Mid-2012 13" Macbook Pro (MacBookPro9,2) TB1 -> RX 460 (AKiTiO Node)
+ macOS 10.14.1+Win10
+ Linux Mint 19


ReplyQuote
Page 1 / 2 Next