tencent cloud

Using Windows Cloud GPU Service to build a Deep Learning Environment
Last updated:2026-01-19 11:54:20
Using Windows Cloud GPU Service to build a Deep Learning Environment
Last updated: 2026-01-19 11:54:20
Note
This article is contributed by GPU cloud server users as part of a best-practice collection. It is provided for learning and reference only.

Scenarios

This article introduces how to use Windows GPU through the CVM console to set up a deep learning environment.

Instance Environment

Instance Type: GN8.LARGE56
Operating System: Windows Server 2019 Datacenter Edition 64-bit
CPU:Intel(R) Xeon(R) CPU E5-2680 v4 @2.40GHz 2.40GHz * 6vCPUs
RAM: 56GB
GPU: Tesla P40 * 1
Drivers, Related Libraries, and Software Versions: CUDA 10.2, Python 3.7, Pytorch 1.8.1, Tensorflow_gpu_2.2.0

Select Driver and Related Libraries, Software Versions

Before you install the drivers, you need to have a general understanding of the version compatibility between CUDA, cuDNN, Pytorch, TensorFlow, and Python, so that you can select the compatible version based on the actual configuration to avoid issues such as version mismatches later on.

Procedure

Instance Creation

Refer to Purchase NVIDIA GPU Instances to create a GPU instance. If you already have a GPU instance, see Reinstalling the System to reset the operating system of your existing instance.

Install Driver, CUDA and cuDNN

Install the GPU Driver

1. Refer to Connecting to a Windows Instance via WebRDP (Recommended) to log in to the created GPU instance.
2. Visit the NVIDIA website in a browser and select the GPU driver version. The configuration selected in this article is shown in the figure below:


3. Click SEARCH to enter the download page, then click Download. If you prefer downloading the installer locally and uploading it to the Cloud GPU Service instance via FTP, see How to Upload Local Files to CVM.
4. After the download is complete, double-click the installation package and follow the prompts on the page to complete the installation.

Install CUDA

1. Go to CUDA Toolkit Archive and select the required version. This article uses CUDA 10.2 as an example:


2. Go to the CUDA Toolkit 10.2 Download page and select the corresponding system configuration. The configuration selected in this article is shown in the figure below:


3. Click Download to start the download.
4. After the download is complete, double-click the installation package and follow the prompts on the page to proceed with the installation. Note the following steps:
In the pop-up CUDA Setup Package window, the Extraction path is a temporary storage location. No modification is required; leave it as default and click OK, as shown below:


In the License Agreement step, select Custom and click Next. Select components based on your needs and click Next, as shown below:

Follow the remaining prompts and options as needed until installation completes.

Configure Environment Variables

1. On the OS desktop, right-click the icon

in the lower-left corner, and select Run from the pop-up menu.
2. In the Run window, enter sysdm.cpl and click OK.
3. In the opened System Properties window, select the Advanced tab and click Environment Variables. 
4. Select Path in the system variables , and click Edit.
5. In the Edit environment variable window, click New and add the following entries:
C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2
C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2\\bin
C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2\\libnvvp
C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2\\lib\\x64
C:\\Program Files\\NVIDIA Corporation\\NVSMI
After editing, the result is shown below:


6. Click OK three times to save the settings.

Verify the GPU Driver and CUDA

1. On the OS desktop, right-click the icon

, and select Run from the pop-up menu.
2. In the Run window, enter cmd and click OK.
3. In the cmd window:
Run the following command to check whether the GPU driver is installed.
nvidia-smi
If the output screen is similar to the screenshot below, the GPU driver has been installed successfully. When the GPU is in use, this command also shows GPU utilization.


Run the following command to verify whether CUDA is installed successfully.
nvcc -V
If the output screen is similar to the screenshot below, CUDA has been installed successfully.



Install cuDNN

1. Go to the cuDNN Download page, click Archived cuDNN Releases to view more versions.
2. Find and download the required cuDNN version.
3. Extract the cuDNN archive, and copy the bin, include, and lib folders to the C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.2.
4. cuDNN installation is now complete.

Install Deep Learning Libraries

Install Anaconda

It is recommended to install PyTorch and TensorFlow in a virtual environment created with Anaconda. With Anaconda, you can easily obtain and manage packages, and manage environments in a unified way. Anaconda includes more than 180 scientific packages and dependencies (including conda and Python). It is easy to install, supports high-performance Python and R usage, and provides free community support.
1. Go to the Anaconda official website, scroll to the bottom of the page, and select archive to view more versions.
2. Download the required version on the page. This document uses Anaconda3-2019.03-Windows-x86_64 as an example, as shown below:


3. Double-click the installer and follow the on-screen instructions to proceed with the installation. Note the following steps:
In the Choose Install Location, change the default installation path. The default location uses the hidden ProgramData folder on drive C. For easier management, it is recommended to install Anaconda in another folder. The default path is shown below:


In the Advanced Installation Options, select all options to add Anaconda to environment variables and set Python 3.7 as the interpreter:


4. Click Install and wait for the installation to complete.

Configure Anaconda

1. On the OS desktop, click the icon

in the lower-left corner, and select Anaconda Prompt. 
2. In the opened Anaconda Prompt command-line window, run the following command to create a virtual environment.
conda create -n xxx_env python=3.7
Note
xxx_env is the environment name, python=3.7 is the Python version. You can modify them based on your needs.
After successful creation, it appears as shown below:

Use the following commands to enter or exit the virtual environment. Once activated, you can install packages as required.
#Activation Command
conda activate xxx_env
#Exit Command
conda deactivate

Install Pytorch

Go to the Pytorch and use the official recommended installation command. This article uses CUDA 10.2 and installs via pip. Run the following command inside the created xxx_env environment:
# CUDA 10.2
pip install torch==1.8.1+cu102 torchvision==0.9.1+cu102 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
To speed up the installation, change to the Tsinghua source mirror and run the following command:
# CUDA 10.2
pip install torch==1.8.1+cu102 torchvision==0.9.1+cu102 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html -i https://pypi.tuna.tsinghua.edu.cn/simple

Install Tensorflow

Run the following command to install Tensorflow_gpu_2.2.0.
pip install tensorflow-gpu==2.2.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
Run the following command to install keras.
pip install keras -i https://pypi.tuna.tsinghua.edu.cn/simple
At this point, the basic deep learning libraries have been installed. You can install additional packages as needed, and start learning by using Anaconda’s built-in tools such as Jupyter Notebook and Spyder, or by installing tools like PyCharm.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback