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

A brief analysis of the function calling process under the ARM architecture

Table of contents 1. Background knowledge 1. Intr...

Basic commands for MySQL database operations

1. Create a database: create data data _name; Two...

jQuery plugin to implement minesweeper game (2)

This article shares the second article of using j...

HTML is the central foundation for the development of WEB standards

HTML-centric front-end development is almost what ...

Disable autocomplete in html so it doesn't show history

The input box always displays the input history wh...

Mysql implementation of full-text search and keyword scoring method example

1. Introduction Today a colleague asked me how to...

CSS hacks \9 and \0 may not work for hacking IE11\IE9\IE8

Every time I design a web page or a form, I am tr...

Specific use of MySQL global locks and table-level locks

Table of contents Preface Global Lock Table lock ...

Docker MQTT installation and use tutorial

Introduction to MQTT MQTT (Message Queuing Teleme...

Vue v-model related knowledge summary

​v-model is a Vue directive that provides two-way...

Embedded transplant docker error problem (summary)

After a long period of transplantation and inform...

Summary of MySQL's commonly used database and table sharding solutions

Table of contents 1. Database bottleneck 2. Sub-l...