4

I am trying to benchmark an Intel HD Graphics 520 (integrated) and a AMD Radeon R5 M330 (dedicated), but I am not able to specify for Unigine Superposition which GPU to use. Here is the result window from a benchmark I ran: Unigine Superposition Results As you can notice both GPUs are listed, but since the listed driver is i915, I can say the GPU that was benchmarked is the Intel, and another clue is that in the main window for changing the benchmark settings (resolution, shader quality, textures quality, etc...) It says there are 3GBs of VRAM, and in this result window it says that the Intel GPU has 3GBs, so I am sure it is benchmarking the Intel GPU.

Now the question is:

How can I benchmark the AMD GPU? I tried using DRI_PRIME=1 which always works with other software of all kinds, but it didn't work with this benchmark. When I use DRI_PRIME=1 I got almost the same result (753 to be exact), and the same details under Configuration. Also 3GBs of Graphics RAM in the main window, which confirms it is still using the Intel GPU.

  • Ubuntu 17.04
  • Intel HD Graphics 520 / AMD Radeon R5 M330
  • Mesa 17.3.0-devel - padoka PPA
Tooniis
  • 1,572

3 Answers3

1

Try adding DRI_PRIME=1 to your ~/.bashrc and then run it from command line on a newly opened terminal after modifying ~/.bashrc. In theory, if Superposition is spawning other processes they might now have DRI_PRIME set. Keep in mind that this will set DRI_PRIME=1 for everything you run which might not be the behavior you want but might fix it while you run Superposition.

You can easily add it to the end of ~/.bashrc by opening it with a text editor or from a terminal with this command: echo "DRI_PRIME=1" | tee -a ~/.bashrc

To remove it you can open it with a text editor and delete it or from a terminal run: sed -i '/DRI_PRIME=1/d' ~/.bashrc

user3325563
  • 139
  • 8
  • I haven't tried the /etc/environment solution described here but the approach is the same as described above, from a text editor or command line add DRI_PRIME=1 in a new line at the end of the file. – user3325563 Sep 20 '17 at 17:45
  • Unfortunately neither solutions worked. – Tooniis Sep 21 '17 at 11:32
0

Ubuntu uses the integrated graphics by default and you are going to need to follow a similar procedure the one described here but adapted for a Radeon card.

First you'll need to install a driver for the AMD Radeon R5 M330. There are a few options out there and your bench mark will be tied to the driver you use, expect variations among them. See benchmark example here.

From most searches it seems like it is not officially supported, AMD support site lists R5 200, 300 and 340 but no 330; but from here it seems like you could just use the fglrx driver.

I don't have a Radeon card or a good suggestion on which driver to use. If you don't know what to install, personally I would start by installing the "recommended" from the output of sudo ubuntu-drivers devices as described in the first guide referenced if it returns something.

user3325563
  • 139
  • 8
  • Could you provide the output to sudo lshw -c video? – user3325563 Sep 14 '17 at 04:37
  • The driver I'm using is radeon, but with the padoka PPA it updates to Mesa 13.0, also fglrx is obsolete since 16.04. – Tooniis Sep 14 '17 at 09:59
  • Also why do you think I don't have a driver for the AMD GPU? Even if I never installed one there will be one installed by default which is either radeon or amdgpu. – Tooniis Sep 14 '17 at 10:01
  • DRI_PRIME=1 is the most popular (or only?) way to switch between Intel and AMD for hybrid graphics machines. I mean that I followed a similar procedure to the one described there but adapted for a Radeon card. – Tooniis Sep 14 '17 at 10:05
  • 1
    You are correct, you should have a driver installed, I meant to bring attention to which driver you were using which I didn't get because of my lack of experience with Mesa. – user3325563 Sep 14 '17 at 14:34
  • How are you running Unigine Superposition? DRI_PRIME=1 might not be i the environment it is running. – user3325563 Sep 14 '17 at 14:36
  • Try running it from command line and passing it export DRI_PRIME=1 <command> similar to like they do here. If it does then that post tells you how to set it in the environment if that's they behavior you would like. – user3325563 Sep 14 '17 at 14:39
  • I ran export DRI_PRIME=1 ./Superposition from a terminal opened at the directory of installation, but it returned `bash: export: './Superposition': not a valid identifier' – Tooniis Sep 14 '17 at 15:19
  • Seems like that mihgt not be the program to run, export is thinking it was another variable instead of an executable, I'm downloading the tool but it's taking forever. – user3325563 Sep 14 '17 at 15:57
  • See if you can find which file executes. either using ll in the installation directory to see which files can be executed or by running it the way you ran it before and finding the process using ps -ef | grpe -i "superposition", the output should have at the end of the line the path of the file executed. – user3325563 Sep 14 '17 at 16:00
  • Ok, I got the tool. My mistake, don't use export, just run it like this DRI_PRIME=1 ./Superposition, that should do. Superposition is your executable, not sure why export wont work with it but if excluded is prety much the same. – user3325563 Sep 14 '17 at 19:21
  • read my question again. I said that DRI_PRIME=1 did nothing (visible to me at least). – Tooniis Sep 14 '17 at 19:26
  • https://chat.stackexchange.com/rooms/65597/discussion-between-user3325563-and-tooniis – user3325563 Sep 14 '17 at 20:16
  • It might be that the Superposition is spawning other processes without passing the DRI_PRIME=1 environment variable, I would try to add it to /etc/environment or ~/.bashrc just to rule that out. You'll need to add it first and then in a newly opened terminal try to run it (or just make sure you source it to the shell). – user3325563 Sep 15 '17 at 01:38
  • 1
    I think you should describe the process of adding that to ~/.bashrc in an answer. – Tooniis Sep 19 '17 at 17:05
0

Using radeontop I found that in fact, it was using the Radeon GPU when I used DRI_PRIME=1. As for it showing 3GBs of VRAM (which when using glxinfo shows that the Intel GPU has), I guess it is a bug in the benchmark itself, or it has been programmed to always show the VRAM of the main GPU.

Tooniis
  • 1,572