How to properly setup intel and nvidia GPUs on Ubuntu?

2 min read 25-10-2024
How to properly setup intel and nvidia GPUs on Ubuntu?

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:

  1. Add the Graphics Drivers PPA:

    sudo add-apt-repository ppa:graphics-drivers/ppa
    sudo apt update
    
  2. Identify the Recommended Driver: You can check the recommended driver version by running:

    ubuntu-drivers devices
    
  3. Install the Driver: Replace nvidia-driver-XX with the recommended version from the previous command:

    sudo apt install nvidia-driver-XX
    
  4. 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:

  1. Download the Installer from Intel’s official site.

  2. Run the Installer: Navigate to the directory where you downloaded the installer and run:

    sudo ./intel-linux-graphics-installer
    
  3. 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:

  1. Open NVIDIA Settings: Type the following in the terminal to launch the settings:

    nvidia-settings
    
  2. 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)".

  3. 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 or glances 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!