In this article, we’ll guide you through the process of setting up Intel/AMD hybrid graphics on Ubuntu 18.04. This process involves using the open-source drivers, switching between GPUs using
xrandr, and understanding the performance of each GPU.
To set up Intel/AMD hybrid graphics on Ubuntu 18.04, you need to use the open-source drivers, switch between GPUs using
xrandr, and understand the performance of each GPU. Avoid installing proprietary AMD drivers as they can cause compatibility issues and instability.
Checking Your GPU Drivers
Firstly, ensure that the open-source drivers are in use. These are
i915 for Intel and
radeon for AMD. You can confirm this by using the following command:
lspci -k | grep -EA3 'VGA|Display'
This command lists all PCI devices and filters for VGA or Display. The
-k option shows the kernel driver handling each device. The output should show
radeon as the kernel drivers for the Intel and AMD GPUs, respectively.
Switching Between GPUs
Ubuntu 18.04 allows you to switch between GPUs using
xrandr. To see the available providers, use the following command:
This command lists all the graphics providers available on your system. You can then use the
xrandr --setprovideroffloadsink command to choose a GPU for specific applications.
For example, to use the AMD GPU for a specific application, use the following command:
application with the name of the application you wish to run on the AMD GPU.
You can test the GPU selection by using the following commands:
DRI_PRIME=0 glxinfo | grep "OpenGL renderer"
DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
The first command tests the Intel GPU, and the second tests the AMD GPU. The output should show the name of the GPU rendering OpenGL.
Benchmarking Your GPUs
To understand the performance of each GPU, you can use
glmark2, a benchmarking tool for OpenGL 2.0. Install it using the following command:
sudo apt install glmark2
Then, run the benchmark for each GPU using the following commands:
The first command benchmarks the Intel GPU, and the second benchmarks the AMD GPU. The results will give you an idea of the performance of each GPU.
Avoiding Proprietary AMD Drivers
While it might be tempting to install the proprietary AMDGPU-PRO drivers, we advise against this. These drivers can cause OpenGL incompatibility issues when launching Steam games. They can also lead to a boot loop and an unstable system.
The open-source drivers provided by Ubuntu are generally sufficient for most users. If you need more performance, consider upgrading your hardware or switching to a different operating system that better supports your hardware.
Setting up Intel/AMD hybrid graphics on Ubuntu 18.04 involves using the open-source drivers, switching between GPUs using
xrandr, and understanding the performance of each GPU. While it might take some time to configure everything, the result is a system that makes full use of your hardware. Remember to avoid the proprietary AMD drivers, as they can cause more problems than they solve.
Yes, you can use Intel/AMD hybrid graphics on other versions of Ubuntu as well. However, the steps and commands mentioned in this article are specifically for Ubuntu 18.04. The process may vary slightly for other versions.
Yes, you can switch between GPUs for specific applications using the
DRI_PRIME environment variable. However, not all applications may be compatible with this feature. Some applications may not utilize the selected GPU and still use the default GPU. It is recommended to test the GPU selection for each application using the commands mentioned in the article.
Yes, you can switch between GPUs without restarting the system using
xrandr and the
DRI_PRIME environment variable. However, the GPU switch will only be effective for newly launched applications. Applications that are already running may not switch to the newly selected GPU until they are restarted.
While it is possible to install the proprietary AMDGPU-PRO drivers, it is not recommended. These drivers can cause compatibility issues with OpenGL, especially when running Steam games. They can also lead to system instability and boot loop issues. It is generally advised to stick with the open-source drivers provided by Ubuntu, as they are more reliable for most users.
To uninstall the proprietary AMDGPU-PRO drivers, you can use the following command:
This command will remove the AMDGPU-PRO drivers from your system and revert to the open-source drivers. After uninstalling, it is recommended to reboot your system for the changes to take effect.