Switch between Intel/AMD GPU on 18.04

59,913

Solution 1

I have been plowing the internet for days over this issue. Had similar setup and problems. I chanced upon here about using DRI_PRIME=1 before any commands to use your dedicated GPU. So I tried

export $DRI_PRIME=1

and this worked. So I added a line it in /etc/environment, DRI_PRIME=1 , rebooted and now System Details shows my AMD card as default.

Caveat: I think this disables the Integrated Graphics and changes your system to just make use your dedicated GPU only

Solution 2

You can find many answers to your question here in Ask Ubuntu:

You should review all of these links.

Additionally you will find many helpful links from other sources:

All the links are too long to summarize in this answer.


Rather than using lspci -nn | grep VGA which will only show your Intel GPU and not your AMD GPU you should try an expanded search using something like this:

$ lspci -k | grep -EA3 'VGA|Display|3D'
00:02.0 VGA compatible controller: Intel Corporation Skylake Integrated Graphics (rev 06)
    DeviceName:  Onboard IGD
    Subsystem: Dell Skylake Integrated Graphics
    Kernel driver in use: i915
--
01:00.0 3D controller: NVIDIA Corporation GM204M [GeForce GTX 970M] (rev a1)
    Subsystem: Dell GM204M [GeForce GTX 970M]
    Kernel driver in use: nvidia
    Kernel modules: nvidiafb, nouveau, nvidia_384_drm, nvidia_384
Share:
59,913

Related videos on Youtube

sticsk
Author by

sticsk

Updated on September 18, 2022

Comments

  • sticsk
    sticsk over 1 year

    I just installed Oibaf's graphics driver, on my laptop, and also Lutris (with Wine and all that) beacuse I want to play games like Diablo 3.

    Everything worked fine, I also installed vulkan, and Wine + Gallium Nine The output of lshw -c video is :

      *-display                 
       description: VGA compatible controller
       product: HD Graphics 5500
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 09
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:45 memory:d3000000-d3ffffff memory:c0000000-cfffffff ioport:7000(size=64) memory:c0000-dffff
     *-display
       description: Display controller
       product: Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:0d:00.0
       version: 83
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi bus_master cap_list rom
       configuration: driver=radeon latency=0
       resources: irq:46 memory:b0000000-bfffffff memory:d5000000-d503ffff ioport:4000(size=256) memory:d5040000-d505ffff
    

    My video card is AMD R5 M430, and the laptop is HP 250 G5

    Also here is the output of lspci -k | grep -EA3 'VGA|Display|3D'

    00:02.0 VGA compatible controller: Intel Corporation HD Graphics 5500 (rev 09)
            Subsystem: Hewlett-Packard Company HD Graphics 5500
            Kernel driver in use: i915
            Kernel modules: i915
    --
    0d:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / R7 M520] (rev 83)
            Subsystem: Hewlett-Packard Company Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / R7 M520]
            Kernel driver in use: radeon
            Kernel modules: radeon, amdgpu
    
    • Alex
      Alex over 5 years
      Have you tried to disable your on-board graphics card from BIOS?
    • sticsk
      sticsk over 5 years
      @Alex I'm afraid that I cannot do it on my HP 250 G5, just checked it.
    • gansub
      gansub almost 5 years
      @sticsk Were you able to get this working i.e. switch from Intel to AMD ?
  • sticsk
    sticsk over 5 years
    The one from August 2018 is mine... and I already reviewed the first and the 3rd one and they aren't working. Switcheroo isn't working either it won't change to the discreet, I made it work it on 16.04 but it still shows that I'm using the Intel one from Settings for example. And AMDGPU driver isn't available for my AMD R5 M430, that's why I installed Oibaf's driver. I'll check the Prime one though
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 5 years
    @sticsk Sorry I didn't pick up on the fact you were one of the authors in the links. You've obviously been doing your homework and trying all the common solutions. Let me know if this answer is unhelpful to you or others and I will delete it. Thank you.
  • sticsk
    sticsk over 5 years
    I updated the lspci command ; EDIT : I will also check the PRIME from Arch and let you know if something's going on.
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 5 years
    The edit to lspci makes it more informative. I just found this you might be interested in: linuxconfig.org/…
  • sticsk
    sticsk over 5 years
    Yep that guide is what I followed into installing Oibaf's driver
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 5 years
    I was wondering if that's where you got it from. I just found a bug report based on your new lspci edit that says radeon driver must be blacklisted to use amdgpu driver: bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1696231
  • sticsk
    sticsk over 5 years
    So you're saying that I have to blacklist amdgpu from kernel modules to make it work? How am I doing this?
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 5 years
    The bug report says radeon has to be blacklisted to make amdgpu work. I cannot speak for what needs to be done. Only pointing out what others are saying. The bug report also says how to blacklist a module. It's fairly straight forward but requires a reboot.
  • sticsk
    sticsk over 5 years
    I undertsand, I will try PRIME from ArchWiki, should I installed the drivers Wiki recommends or let the Oibaf's one?
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 5 years
    I would use Olbaf's as a last resort because that is what we call "Bleeding Edge" technology. I try to stick to the mainstream technology as much as possible. Another piece of advice when dealing with multiple drivers you have to be extract thorough in ensuring the previous one is fully removed before installing a new one. This is a common problem in the nVidia graphics world in Linux.
  • sticsk
    sticsk over 5 years
    Sorry but I tried the PRIME thing, but I just don't understand how to install the amdgpu package from arch :/
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 5 years
    According to a Diablo 3 posting the problem may lie in Wine itself: us.battle.net/forums/en/d3/topic/20761986786
  • sticsk
    sticsk over 5 years
    You know, I just installed Ubuntu on my PC too (Ryzen 5 1500X and GTX960) and Diablo was working flawlessly! ; EDIT : I was asking the same thing, is it Wine or my hardware? And I tested it on my PC and it was working just as good as on Windows
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 5 years
    @sticsk If you've explored all the AMD graphics drivers and there is no solution yet, the last link I commented on Diablo 3 says installing a different Wine version was a solution. Could that be why it's working on a new PC and not the laptop?
  • sticsk
    sticsk over 5 years
    I don't know, I mean I also tried SWAT4, which is an older game, and it's struggling to work too, and it's not even on full resolution (1920x1080)
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 5 years
    @sticsk Here are some special steps someone went through for speedy Swat 4 operations in Linux: gog.com/forum/swat_series/swat_4_for_linux
  • sticsk
    sticsk almost 5 years
    Damn man I actually forgot about this question, idk if this will help someone, if it does let me know to mark it as solved. I switched Ubuntu for months ahahahah
  • roarnald
    roarnald almost 5 years
    Hahahaha I almost gave up to change Ubuntu version too
  • sticsk
    sticsk almost 5 years
    It was good when I started but now I improved and I switched to another distro
  • PvdL
    PvdL about 4 years
    DRI_PRIME=1 steam seems to be enough