[Python] Until CuPy is installed on Windows 10 and CUDA core is used

I was addicted to the introduction, so I wrote an article.

CuPy? NumPy compatible GPU computing library.

Fast calculations in Python. NumPy compatible GPU computing library cupy https://purakaku-python.readthedocs.io/ja/master/chapter_ml/cupy.html

environment

Extract only the range that seems necessary for the article

Type spec/version
CPU Intel Core i7-9700K
RAM DDR4-2133 32GB (8GBx4)
GPU NVIDIA GeForce GTX1080Ti
OS Windows10 Pro 1909 64Bit
CUDA Toolkit10.2 10.2.89
Python3 3.7.6
CuPy v7 7.3.0

Please take responsibility for your actions

CuPy is not guaranteed to work on ** Windows. ** ** In addition, although this page explains how to use it on Windows, we do not recommend using it in an unsupported environment.

Check CUDA version

Execute the following command at the command prompt etc.

nvcc -V

After execution, if you receive the following response, you can confirm normally.

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:32:27_Pacific_Daylight_Time_2019
Cuda compilation tools, release 10.2, V10.2.89

Make a note of the release number on the last line as it will be used when installing CuPy. In this case, there is no problem if you write down only 10.2.

Is that a different response?

'nvcc'Is an internal or external command,
It is not recognized as an operable program or batch file.

If you get such a response, you need to install the CUDA Toolkit.

Install CUDA Toolkit

download

** Download the one that suits your environment from the CUDA Toolkit Download Page **. 200403a.png Either ʻexe [network]or ʻexe [local]can be used.

Installation

Follow the displayed instructions to install as is.

Introduction of CuPy

I will use the numbers I wrote down here. In this case, it was 10.2, so remove the comma and install it as follows.

pip install cupy-cuda102

Reboot the system after the installation completes successfully. The following article will be helpful for how to use it.

Introducing Cupy that can easily calculate GPU with python https://qiita.com/samacoba/items/d18e6cf09f544477aff4

Cannot import

import cupy as cp
Traceback (most recent call last):
File "C:\Users\thzking\AppData\Local\Continuum\anaconda3\lib\sit...
...
(Full error)
...
ImportError: DLL load failed:The specified module cannot be found.

You may be able to solve it by the following methods.

-** Reboot if system has not been rebooted after setup (important) ** --Reconfirm CUDA version --Reinstall CuPy --Reinstalling CUDA Toolkit --Throw and sleep

Recommended Posts

[Python] Until CuPy is installed on Windows 10 and CUDA core is used
Until you create Python Virtualenv on Windows and launch Jupyter
Python 3.6 on Windows ... and to Xamarin.
Integrate Modelica and Python on Windows
Until Windows Subsystem for Linux (WSL) is installed in Windows and fish is installed
I installed and used Numba with Python3.5
Python on Windows
Install and run Python3.5 + NumPy + SciPy on Windows 10
(Windows) Causes and workarounds for UnicodeEncodeError on Python 3
Notes on installing Python3 and using pip on Windows7
Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda
[Note] Installing Python 3.6 + α on Windows and RHEL
Install ZIP version Python and pip on Windows 10
Until drawing a 3D graph in Python on windows10
[Windows] [Python3] Install python3 and Jupyter Notebook (formerly ipython notebook) on Windows
python basic on windows ②
Install python on windows
Until you create a machine learning environment with Python on Windows 7 and run it
Create a decent shell and python environment on Windows
When I installed python on macOS and used it, I got an error when I put an https connection
Install python and Visual Studio Code on windows10 (April 2020 version)
Set-enable Python virtualenv on Windows
Run Openpose on Python (Windows)
Install watchdog on Windows + Python 3.3
Python on Ruby and angry Ruby on Python
Install Python and Flask (Windows 10)
How Python __dict__ is used
Python + Kivy development on Windows
Sphinx-autobuild (0.5.2) on Windows7, Python 3.5.1, Sphinx 1.3.5
Fastest Python installation on Windows
Build Python environment on Windows
[Python] Python and security-① What is Python?
Build python environment on windows
I ran python on windows
[Python] [Chainer] [Windows] Install Chainer on Windows
Use Python on Windows (PyCharm)
Identity and equivalence Python is and ==
Build a 64-bit Python 2.7 environment with TDM-GCC and MinGW-w64 on Windows 7
What to do if PyAudio cannot be installed on Python 3.7, 3.8, 3.9 on Windows
What is Python? What is it used for?
Python environment construction memo on Windows 10
Remove ubuntu installed on Windows 10 machine
Installing Kivy on Windows10 64bit Python3.5
Difference between == and is in python
Anaconda python environment construction on Windows 10
Install CUDA 8.0 and Chainer on Ubuntu 16.04
Install python2.7 on windows 32bit environment
Install xgboost (python version) on Windows
Install Python on Windows + pip + virtualenv
Build and install OpenCV on Windows
Install Pytorch on Blender 2.90 python on Windows
Installing Kivy-Designer on Windows10 64bit Python3.5
Mecab / Cabocha / KNP on Python + Windows
Mastering pip and wheel on windows
Install Python development environment on Windows 10
Python CGI file created on Windows
Getting started with Python 3.8 on Windows
Reproduce One-Touch Search on Python 3.7.3. (Windows 10)
Install easy_install and pip on windows
Put Cabocha 0.68 on Windows and try to analyze the dependency with Python
Put MeCab binding for Python with pip on Windows, mac and Linux