Until you run CuPy (v11.1) on Ubuntu 20.04

Introduction

In this article, I will record the process of installing CuPy to run the GPU on Ubuntu as a memorandum.

The goals are:

  1. Install NVIDIA driver on Ubuntu 20.04

  2. Install CUDA Toolkit 11.1.

  3. Install CuPy 11.1

Execution environment

What I want to do is create a virtual environment using poetry and install various things in it, but I will omit it here.

Installation method

1. Install NVIDIA driver on Ubuntu 20.04

Find the recommended driver with the following command.

ubuntu-drivers devices

You can install the recommended drivers from Additional Software and Update Drivers.

Alternatively, use the following command to add the NVIDIA PPA repository and install the driver.

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt install nvidia-driver-xxx

(Comment: Maybe this is the opposite.)

Once the driver is installed, you can check it with the following command.

nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.27.04    Driver Version: 460.27.04    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce RTX 206...  On   | 00000000:06:00.0  On |                  N/A |
| 29%   31C    P3    39W / 175W |   1114MiB /  7979MiB |     19%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1104      G   /usr/lib/xorg/Xorg                101MiB |
|    0   N/A  N/A      3110      G   /usr/lib/xorg/Xorg                586MiB |
|    0   N/A  N/A      3271      G   /usr/bin/gnome-shell              134MiB |
|    0   N/A  N/A      4748      G   ...AAAAAAAA== --shared-files      212MiB |
+-----------------------------------------------------------------------------+

(Comment: If you can't, reboot.)

2. Install CUDA Toolkit 11.1.

The CUDA Toolkit and CuPy need (should) match versions, so install the version of CUDA Toolkit you need. This time I want to install CuPy 11.1 which is the latest at the moment (2021/1/8), so install 11.1 of CUDA Toolkit accordingly (the latest version at this point is 11.2).

(Comment: CUDA Version: 11.2 is displayed in the upper right of the command display, but it seems that this is the version that can be inserted)

Past versions can be found in the CUDA Toolkit Archive (https://developer.nvidia.com/cuda-toolkit-archive). CUDA Toolkit 11.1.1 -> Linux -> x86_64 -> Ubuntu -> 20.04 -> runfile (local) Proceed in the order of.

Follow the command shown below to install.

wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run
sudo sh cuda_11.1.1_455.32.00_linux.run

Now go to Continue-> accept. In CUDA Installer, uncheck Driver (you can remove it with the enter key). After removing it, proceed to Install.

(Comment: I get an error if I install the Driver.)

3. Install CuPy 11.1

Refer to Official Site and install with the following command in your own virtual environment.

pip install cupy-cuda111

in conclusion

As a result of various trials and errors, I feel that this method was the easiest.

Recommended Posts

Until you run CuPy (v11.1) on Ubuntu 20.04
Until you run apache on ubuntu on docker
Until you put Ubuntu 20 on Windows 10 Home and WSL2 and run Docker
Run tiscamera on Ubuntu 18.04
Run chromium-mir-kiosk on Ubuntu Core
Run java applet on ubuntu
Run Eclipse CDT on Ubuntu
Until you run Quarkus and run docker image on Amazon ECS
Run NordVPN on Docker (Windows) Ubuntu container
Run Ubuntu + ROS with Docker on Mac
Until you start developing android apps on mac
Until you run the Apache Velocity sample code
Until you run mruby in your browser (WebAssembly)
How to run NullpoMino 7.5.0 on Ubuntu 20.04.1 64bit version
tmux on Ubuntu
Ssh to Ubuntu on VirtualBox on your Mac and do it until you install Docker
Until you publish the app on the App Store by yourself
I tried using YOLO v4 on Ubuntu and ROS
Screen recording on Ubuntu 20.04
Web Bluetooth on Ubuntu20.04
Run STS4 on Mac
Try DisplayLink on Ubuntu 20.04
Reinstall Kubernetes on Ubuntu 19.10
Use Flutter on Ubuntu
Tomcat v8 on CentOS7
Test run on rails
Run PostgreSQL on Java
Install Ruby on Ubuntu 20.04
Setting JAVA_HOME on Ubuntu
Jetty v8 on CentOS7
Install Autoware on Ubuntu 18.04.5
Put JetBrains on Ubuntu
Use mkdir on ubuntu
Apache2 on Ubuntu20.04 LTS
Use cpplapack on ubuntu
ubuntu on wsl part 10
Install Homebrew on Ubuntu 20.04
Run Processing on Ant
Build Zabbix on Ubuntu 20.04
Run phpunit on Docker
Until you start nginx on CentOS using Docker on Mac OS