Manjaro installation CUDA implementation tutorial analysis

Manjaro installation CUDA implementation tutorial analysis

At the end of last year, I replaced the opensuse in the dual system of my Thinkpad T450 with Manjaro, and installed CUDA for the record.

Basic Installation

NVIDIA graphics card installation

It is relatively simple to install a graphics card in the Manjaro system. It has a command

sudo mhwd -a [pci or usb connection] [free or nonfree drivers] 0300

in

  • -a: Automatically detect and install the appropriate graphics driver
  • [pci or usb]: Install drivers for devices connected via PCI or USB
  • [free or nonfree]: Install free or nonfree drivers
  • 0300: Confirm the graphics card driver to be installed

We need to install NVIDIA's driver, just use the following line of command to do it

sudo mhwd -a pci nonfree 0300

Wait for the installation to complete and use the following command to check whether the installation is complete

nvidia-smi

My graphics card model is GeForce 940M and the graphics card driver version is 415.27.

CUDA Installation

Installation Commands

Manjaro's CUDA installation is also very simple, just one line of command to complete it

sudo pacman -S cuda cudnn
This command may take some time, please be patient.

Verify Installation

After completion, we enter the installation path of cuda, my path is /opt/cuda, you can use the following command to copy the CUDA sample program to your user home directory, and then compile the program

cp -r /opt/cuda/samples ~
cd ~/samples
make

Now use the nvcc compiler to compile the CUDA sample program. This will take longer, about half an hour. Wait for the compilation to complete and use the following command to verify whether it is successful.

cd ~/samples/bin/x86_64/linux/release
./deviceQuery

Check whether the result of the last line in the window is pass. If it is, it means that CUDA is installed successfully.

Dual Graphics Card Configuration

My computer has two graphics cards, one is an Intel integrated graphics card and the other is a NVIDIA discrete graphics card.

Install the graphics card switcher

There are some problems with Manjaro's dual graphics card configuration, and Bumblebee still has some problems. Use the following command to reinstall

# Dependencies
sudo pacman -S virtualgl lib32-virtualgl lib32-primus primus

# Install the dual graphics card switching program bumblebee
sudo mhwd -f -i pci video-hybrid-intel-nvidia-bumblebee

# Allow services
sudo systemctl enable bumblebeed

# Add users
sudo gpasswd -a $USER bumblebee

In order to prevent the inability to enter the login interface after restart, the following configuration is required

  • Open /etc/default/grub
  • Find and change to: GRUB_CMLINE_LINUX_DEFAULT="quiet acpi_osi=! acpi_osi=Linux acpi_osi='Windows 2015' pcie_port_pm=off resume=..."
  • Run sudo update-grub and reboot

Test graphics card performance

Use the following shell command to install the graphics card test program

# Install test software
sudo pacman -S mesa-demos

# Integrated graphics performance
glxgears -info

# Discrete Graphics Performance
optirun glxgears -info
# or
primusrun glxgears -info

It should be noted that for all programs run later, if you need to use a discrete graphics card, you need to add the prefix optirun or primusrun in front of the command.

# Open nvidia panel
optirun -b none nvidia-settings -c :8

# Use CUDA without relying on Bumblebee
sudo tee /proc/acpi/bbswitch <<< 'ON'

# Stop NVIDIA graphics card after using CUDA
sudo rmmod nvidia_uvm nvidia && sudo tee /proc/acpi/bbswitch <<< OFF

inxi -G # Check the graphics card status
optirun nvidia-smi # Check CPU status

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Flutter super practical simple menu pop-up box PopupMenuButton function
  • Under the ubutu 16.04 environment, PHP and mysql database, web page login verification example explanation
  • Detailed tutorial on installing php7.1x with ubutun
  • How to use MenuButton in EasyUI
  • jQuery EasyUI API Chinese Documentation - MenuButton Menu Button Usage Introduction
  • A super detailed tutorial on installing the development environment for Deepin20
  • Goland activation code cracking permanent version and installation detailed tutorial (professional test)
  • Goland installation and activation tutorial (window, linux installation)
  • Detailed tutorial on installation and deployment of superset in Linux and Windows
  • Ubutu1604 installation colmap implementation method detailed tutorial

<<:  MySQL 8.0.22 installation and configuration graphic tutorial

>>:  Vue encapsulates the public function method of exporting Excel data

Recommend

Detailed explanation of CSS3 animation and new features of HTML5

1. CSS3 animation ☺CSS3 animations are much easie...

Teach you how to build a Hadoop 3.x pseudo cluster on Tencent Cloud

1. Environmental Preparation CentOS Linux release...

Interpreting MySQL client and server protocols

Table of contents MySQL Client/Server Protocol If...

HTML 5 Preview

<br />Original: http://www.alistapart.com/ar...

Draw an iPhone based on CSS3

Result:Implementation Code html <div class=...

Example analysis of the principle and solution of MySQL sliding order problem

This article uses examples to explain the princip...

Linux system to view CPU, machine model, memory and other information

During system maintenance, you may need to check ...

MySQL Server 8.0.13.0 Installation Tutorial with Pictures and Text

Install 8.0.13 based on MySQL 6.1.3. MySQL 8.0.13...

Vue realizes cascading selection of provinces, cities and districts

Recently, I need to implement a cascading selecti...

Completely uninstall mysql. Personal test!

Cleanly uninstall MySQL. Personally tested, this ...

Nginx uses the Gzip algorithm to compress messages

What is HTTP Compression Sometimes, relatively la...

The difference between html form submission action and url jump to actiond

The action of the form is different from the URL j...

XHTML Web Page Tutorial

<br />This article is mainly to let beginner...