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

MySQL multi-table join introductory tutorial

Connections can be used to query, update, and est...

Reasons for the sudden drop in MySQL performance

Sometimes you may encounter a situation where a S...

Detailed explanation of the use of Docker commit

Sometimes you need to install certain dependencie...

Analysis of the causes of accidents caused by Unicode signature BOM

Maybe you are using include files here, which is u...

Native JS implements a very good-looking counter

Today I will share with you a good-looking counte...

Implementation and optimization of MySql subquery IN

Table of contents Why is IN slow? Which is faster...

MySql development of automatic synchronization table structure

Development Pain Points During the development pr...

MySQL stored functions detailed introduction

Table of contents 1. Create a stored function 2. ...

JavaScript commonly used array deduplication actual combat source code

Array deduplication is usually encountered during...

Example of using mycat to implement MySQL database read-write separation

What is MyCAT A completely open source large data...

Before making a web page, let’s take a look at these so-called specifications

This article has compiled some so-called specific...

Implementation example of Vue+Element+Springboot image upload

Recently, I happened to be in touch with the vue+...

Explanation of the problem that JavaScript strict mode does not support octal

Regarding the issue that JavaScript strict mode d...