Setting up Intel and NVIDIA GPUs on Ubuntu can enhance your computer's performance and ensure that you can run demanding applications efficiently. In this guide, we’ll walk you through the installation and configuration process to help you make the most of your hardware. We’ll also cover troubleshooting tips to resolve common issues.
Prerequisites
Before you start, ensure that you have:
- A computer running Ubuntu (preferably 20.04 LTS or newer)
- An Intel integrated GPU and an NVIDIA dedicated GPU
- Internet access
Step 1: Install Required Packages
You need to install essential packages, including the NVIDIA driver and CUDA toolkit. Open a terminal and run the following commands:
sudo apt update
sudo apt install build-essential linux-headers-$(uname -r)
Step 2: Install NVIDIA Drivers
To install NVIDIA drivers, follow these steps:
-
Add the Graphics Drivers PPA:
sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt update
-
Identify the Recommended Driver: You can check the recommended driver version by running:
ubuntu-drivers devices
-
Install the Driver: Replace
nvidia-driver-XX
with the recommended version from the previous command:sudo apt install nvidia-driver-XX
-
Reboot: After the installation, reboot your computer:
sudo reboot
Step 3: Install Intel Graphics Drivers
Intel graphics drivers are usually included with Ubuntu, but if you want the latest version, you can install the Intel Graphics Installer:
-
Download the Installer from Intel’s official site.
-
Run the Installer: Navigate to the directory where you downloaded the installer and run:
sudo ./intel-linux-graphics-installer
-
Follow the Prompts: Complete the installation by following the on-screen instructions.
Step 4: Configure the GPUs
4.1 Using NVIDIA Prime
To switch between Intel and NVIDIA GPUs, Ubuntu uses a tool called NVIDIA Prime. Here’s how to configure it:
-
Open NVIDIA Settings: Type the following in the terminal to launch the settings:
nvidia-settings
-
Set Preferred GPU: In the "NVIDIA X Server Settings" window, navigate to "PRIME Profiles". You can select either "NVIDIA (Performance Mode)" or "Intel (Power Saving Mode)".
-
Reboot Again: After making changes, reboot your system to apply them.
4.2 Testing the Setup
To ensure everything is working correctly, run the following command:
nvidia-smi
If the setup is successful, you should see information about the NVIDIA GPU.
Additional Tips
- Monitor GPU Usage: You can use tools like
htop
orglances
to monitor system resource usage in real-time. - Overclocking and Advanced Settings: If you're interested in overclocking your NVIDIA GPU, you can do so via the
nvidia-settings
tool.
Troubleshooting Common Issues
- Black Screen After Installing NVIDIA Drivers: This often happens if the driver is not compatible. Use
Ctrl+Alt+F1
to access a terminal and reinstall the correct driver. - NVIDIA GPU Not Detected: Ensure the NVIDIA drivers are properly installed and check the
nvidia-smi
command for any output.
Useful Resources
Conclusion
By following this guide, you should be able to set up both Intel and NVIDIA GPUs on your Ubuntu system effectively. Proper configuration allows you to leverage the strengths of both GPUs—using the integrated Intel graphics for everyday tasks and switching to the dedicated NVIDIA GPU for more intensive tasks like gaming or graphical work.
Don’t hesitate to experiment with your GPU settings to find the best performance that suits your needs!