Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to upgrade cuda9.2 to cuda10.2 under windows10

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to upgrade cuda9.2 to cuda10.2 under windows10", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "how to upgrade cuda9.2 to cuda10.2 under windows10" this article.

I. the main contents of the article

1. Upgrade from cuda9.2 to cuda10.2 under Windows10

2. Install cudnn under Windows10

3. Performance comparison of cuda9.2, cuda10.2, cudnn7.2.1 and cudnn7.6.5 in DeepLearning4j

II. Installation process

1. Machine environment description:

CPU:i7 8700 6 Core 12 Thread

GPU:GTX 1070Ti

Memory: 16GB

Note: cuda and cudnn have been installed on the machine, and the versions are: cuda9.2.148, cudnn7.2.1

2. Prepare the installation package

(1), cuda download

Cuda download address: https://developer.nvidia.com/cuda-toolkit-archive, the download version here is 10.2, because dl4j only supports up to 10.2.

The installation machine is windows10 64-bit, select the 64-bit version of cuda win10, select local in the installation mode, and download the installation package to the local installation.

(2), cuDNN download

Download address: https://developer.nvidia.com/rdp/cudnn-archive. Choose the latest cudnn version that matches cuda10.2: 7.6.5. The reason for not choosing 8.0.2 here is that dl4j-beta6 does not support 8.x version.

The installation packages downloaded are as follows:

3. Install cuda10.2

Directly follow the default installation path, next, agree and continue-> streamlined installation

Enter the installation phase

After the installation, under the C:\ Program Files\ NVIDIA GPU Computing Toolkit\ CUDA directory, the v10.2 folder appears, as shown below:

Note: there is a v9.2, which is the previously installed version of cuda. Set the environment variable, or you can switch to the 9.2 version.

Open the cmd console, enter the nvcc-- version command, enter enter, as shown in the following figure, indicating that version 10.2 is installed successfully

At the same time, use dl4j's latest example test to verify whether cuad10.2 is available, example address: https://github.com/eclipse/deeplearning4j-examples/tree/master/mvn-project-template

Modify the maven dependency to the following configuration, where dl4j-master.version is modified to: 1.0.0-beta6, adding nd4j-cuda-10.2-platform and deeplearning4j-cuda-10.2 dependencies

1.0.0-beta6 1.2.3 1.8 2.4.3 org.deeplearning4j deeplearning4j-core ${dl4j-master.version} org.nd4j nd4j-cuda-10.2- Platform ${dl4j-master.version} org.deeplearning4j deeplearning4j-cuda-10.2 ${dl4j-master.version} ch.qos.logback logback-classic ${logback.version}

Run as the main method. Print the log as follows: ND4J CUDA build version: 10.2.89, indicating that cuda10.2 has taken effect.

O.d.e.s.LeNetMNIST-Load data....o.d.e.s.LeNetMNIST-Build model....o.n.l.f.Nd4jBackend-Loaded [JCublasBackend] backendo.n.n.NativeOpsHolder-Number of threads used for linear algebra: 32o.n.n.Nd4jBlas-Number of threads used for OpenMP BLAS: 0o.n.l.a.o.e.DefaultOpExecutioner-Backend used: [CUDA]; OS: [Windows 10] o.n.l.a.o.e.DefaultOpExecutioner-Cores: [12] Memory: [3.5GB]; o.n.l.a.o.e.DefaultOpExecutioner-Blas vendor: [CUBLAS] o.n.l.j.JCublasBackend-ND4J CUDA build version: 10.2.89o.n.l.j.JCublasBackend-CUDA device 0: [GeForce GTX 1070 Ti]; cc: [6.1]; Total memory: [8589934592] o.d.n.m.MultiLayerNetwork-Starting MultiLayerNetwork with WorkspaceModes set to [training: ENABLED Inference: ENABLED] CacheMode set to [NONE] o.d.n.l.c.ConvolutionLayer-Could not initialize CudnnConvolutionHelperjava.lang.reflect.InvocationTargetException: null at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance (Constructor.java:423) at org.deeplearning4j.nn.layers.convolution.ConvolutionLayer .initializeHelper (ConvolutionLayer.java:78) Caused by: java.lang.UnsatisfiedLinkError: no jnicudnn in java.library.path at java.lang.ClassLoader.loadLibrary (ClassLoader.java:1867) at java.lang.Runtime.loadLibrary0 (Runtime.java:870) at java.lang.System.loadLibrary (System.java:1122) at org.bytedeco.javacpp.Loader.loadLibrary (Loader.java:1543) at org.bytedeco.javacpp.Loader.load (Loader.java:1192)

In the log above, there is an exception that cudnn cannot be initialized because cudnn has not yet been installed, and then you can install cudnn.

4. CuDNN installation

Extract the cudnn-10.2-windows10-x64-v7.6.5.32.zip and the three folders shown in the following figure appear

Copy these three folders to the C:\ Program Files\ NVIDIA GPU Computing Toolkit\ CUDA\ v10.2 directory. Cudnn files are added to the cuda installation directory

Run the test program again, the exception disappears, and CudnnSubsamplingHelper and CudnnConvolutionHelper initialize successfully

O.d.e.s.LeNetMNIST-Load data....o.d.e.s.LeNetMNIST-Build model....o.n.l.f.Nd4jBackend-Loaded [JCublasBackend] backendo.n.n.NativeOpsHolder-Number of threads used for linear algebra: 32o.n.n.Nd4jBlas-Number of threads used for OpenMP BLAS: 0o.n.l.a.o.e.DefaultOpExecutioner-Backend used: [CUDA]; OS: [Windows 10] o.n.l.a.o.e.DefaultOpExecutioner-Cores: [12] Memory: [3.5GB]; o.n.l.a.o.e.DefaultOpExecutioner-Blas vendor: [CUBLAS] o.n.l.j.JCublasBackend-ND4J CUDA build version: 10.2.89o.n.l.j.JCublasBackend-CUDA device 0: [GeForce GTX 1070 Ti]; cc: [6.1]; Total memory: [8589934592] o.d.n.m.MultiLayerNetwork-Starting MultiLayerNetwork with WorkspaceModes set to [training: ENABLED Inference: ENABLED], cacheMode set to [NONE] o.d.n.l.c.ConvolutionLayer-CudnnConvolutionHelper successfully initializedo.n.j.h.i.CudaZeroHandler-Creating bucketID: 5o.d.n.l.c.s.SubsamplingLayer-CudnnSubsamplingHelper successfully initializedo.d.n.l.c.ConvolutionLayer-CudnnConvolutionHelper successfully initializedo.d.n.l.c.s.SubsamplingLayer-CudnnSubsamplingHelper successfully initialized

At this point, cuda10.2 and cudnn7.6.5 are installed successfully, and dl4j beta6 can run normally.

Third, performance comparison

Test program address: https://github.com/eclipse/deeplearning4j-examples/tree/master/mvn-project-template, network structure is LeNet

Environment description:

Operating system: Windows10

CPU:i7 8700 3.2GHz 6 Core 12 Thread

GPU:GTX 1070Ti

Memory: 16GB

Dl4j:beta6

Comparison results:

Running environment time-consuming (ms) CPU26566cuda9.220725cuda9.2+cudnn7.2.112575cuda10.219953cuda10.2+cudnn7.6.512574

The results show that:

1. There is little difference between cuda9.2 and cuda10.2.

2. The running results of cuda9.2+cudnn7.2.1 and cuda10.2+cudnn7.6.5 are not much different.

3. The running efficiency of cudnn has been significantly improved.

4. The efficiency of GPU combined with cudnn is 2 times higher than that of CPU.

Special note: dl4j optimizes the following structure based on cudnn, as shown in the following figure:

These are all the contents of the article "how to upgrade cuda9.2 to cuda10.2 under windows10". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 226

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report