index_img: https://s2.232232.xyz/static/266/2022/11/06-63675d3d7dca5.jpg
title: Installing NVIDIA Graphics Card on Ubuntu
date: 2022-09-19 10:09:13
updated: 2022-09-19 10:09:13
comments: true#
Step 1: Disable the default graphics card driver in Ubuntu.
If vim is not installed, run the following command:
sudo apt install vim
Open the blacklist.conf file using vim:
sudo vim /etc/modprobe.d/blacklist.conf
Add the following line at the end:
blacklist nouveau
options nouveau modeset=0
Save and exit.
Update the initramfs to apply the changes:
sudo update-initramfs -u
Reboot the system for the changes to take effect.
To install the graphics card driver, switch to the text interface first (press Ctrl+Alt+F3).
Use the following command to check if nouveau is disabled. If there is no output, it means nouveau is successfully disabled:
lsmod | grep nouveau
Disable the Ubuntu graphical interface:
sudo service lightdm stop
Navigate to the NVIDIA driver directory:
cd NVIDIA_driver_directory
Make the NVIDIA driver executable:
chmod +x NVIDIA_driver
Run the NVIDIA driver installation:
sudo ./NVIDIA_driver
Follow the prompts to complete the installation, then enter "init 5" to enter the graphical interface.
Verify the successful installation of the driver:
sudo nvidia-smi
If the graphics card model is displayed, the installation is successful.