0

I would like to test my dedicated graphics card on my ubuntu partition, but I can't run anything with it. It just defaults to the Intel Graphics Card, instead of my AMD Radeon M360. The graphics card shows up when I use the command

$ lspci -nn | grep -E 'VGA|Display'

This is the output:

00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 5500 [8086:1616] (rev 09)
04:00.0 Display controller [0380]: Advanced Micro Devices, Inc. [AMD/ATI] Topaz XT [Radeon R7 M260/M265 / M340/M360 / M440/M445 / 530/535 / 620/625 Mobile] [10... (rev 81)

And I've seen elsewhere on the web that using DRI_PRIME=1 before the program you wish to run should switch to the dedicated graphics card, but in my case it doesn't work.

For example when I try the benchmark glmark2 by running the following command:

DRI_PRIME=1 glmark2

This happens:

=======================================================
    glmark2 2014.03+git20150611.fa71af2d
=======================================================
    OpenGL Information
    GL_VENDOR:     Intel
    GL_RENDERER:   Mesa Intel(R) HD Graphics 5500 (BDW GT2)
    GL_VERSION:    4.6 (Compatibility Profile) Mesa 20.0.8

Followed by the benchmark results. Same thing if I try with DRI_PRIME=0, or DRI_PRIME=2. Anyone have any other way to switch GPU's in order to test it?

For context, I've been having issues with my laptop on my windows partition, and I feel like the issue lays on my graphics card or it's drivers. Windows just freezes (no blue screen or anything. Just freezes everything, including all input) after a few minutes of being on. After trying to fix it by resetting windows now the Windows partition is broken, so before fixing it, I'd like to test the GPU on ubuntu to make sure that the hardware is not the issue, but it lays on software.

Thank you all in advance.

2
  • The implementation of discrete graphics in laptops is not usually the same as a desktop computer with a dedicated GPU. These laptops often have "hybrid graphics" and you might not have an option to use one and not another. I would check your BIOS/firmware settings to see if there are any options to do what you are asking. Arch documentation has a good writeup on this: wiki.archlinux.org/index.php/Hybrid_graphics – Nmath Dec 31 '20 at 8:09
  • My bios screen has two options: Switchable graphics and just the intel graphics card. It's set to the switchable graphics. When I use just the intel graphics card option (i don't quite remember the exact name of the option), the amd gpu doesn't show up at all when doing the lspci command – Diatrix Jan 1 at 5:45
0

One option would be to use vgaswitcheroo to disable the integrated graphics card.

Open a terminal and do this:

$ sudo su
$ cd /sys/kernel/debug/vgaswitcheroo
$ cat switch

You should see an output that looks something like this:

0:DIS-Audio: :DynOff:0000:01:00.1
1:IGD:+:Pwr:0000:00:02.0
2:DIS: :DynOff:0000:01:00.0

Notes:

  • IGD is the Integrated Graphics Display
  • DIS is the Discrete graphics device
  • + is the active device
  • Pwr means the device is powered on
  • Off means the device is powered off
  • DynOff means the device has dynamically powered itself off, but can control its own power

How to change these values:

Command Result
echo OFF>switch Power off the inactive card
echo ON>switch Power on the inactive card
echo DIS>switch Switch to the discrete card immediately
echo DDIS>switch Switch to the discrete card after restarting X
echo IGD>switch Switch to the integrated graphics card immediately
echo DIGD>switch Switch to the integrated graphics card after restarting X

With this in mind, it sounds like you will want to do this:

  1. If the Radeon shows Off rather than DynOff, power it up: echo ON>switch
  2. Switch to the Discrete device: echo DIS>switch
  3. Power off the integrated graphics device: echo OFF>switch

Hopefully this gives you what you need.

4
  • I'm trying to, but it seems that vgaswitcheroo is for ubuntu 10.04. I can't seem to be able to run the command on 20.04, and the directory for the tool does not exist. I can't seem to find a way to install it anywhere. Maybe it's an outdated function? – Diatrix Jan 15 at 22:15
  • I usually try every suggestion I offer on here before writing it up because it does nobody any good if the time spent writing, reading, and trying the answer is wasted. This works on two of my notebooks running stock Ubuntu 20.04. I'll do a bit more digging on my side to see if there's another option 🤔 – user1091774 Jan 15 at 23:25
  • Weird... I might just wipe my HDD and reinstall everything from scratch. – Diatrix Jan 17 at 0:03
  • Although, now thinking about it, I might try with a bootable flashdrive with 20.04 – Diatrix Jan 17 at 0:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.