---
title: 运行和验证
description: "1. 使用PuTTY工具，以root用户登录服务器。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpcindapp/prtg-osc/kunpengthrust_02_0010.html
sourcePath: /source/zh/kunpenghpcs/hpcindapp/prtg-osc/kunpengthrust_02_0010.html
indexId: b856c813350fb411f71cdd44f3ca4ac304358d35f2b48f1b9dbfb193b650460768
---
# 运行和验证

#### 操作步骤

1. 使用PuTTY工具，以root用户登录服务器。
2. 执行以下命令验证Thrust版本。

  a. 进入目录。

```
cd
/path/to/thrust
/include
```


  b. 创建“version.cu”文件。

```
vim version.cu
```


  c. 按“i”进入编辑模式，输入以下内容。

```
#include <thrust/version.h>
#include <iostream>
int main(void)
{
int major = THRUST_MAJOR_VERSION;
int minor = THRUST_MINOR_VERSION;
std::cout << "Thrust v" << major << "." << minor << std::endl;
return 0;
}
```


  d. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
  e. 执行以下命令验证。

```
nvcc version.cu -o version
./version
```


    回显显示信息如下图所示。

3. 执行以下命令验证自带示例测试。

```
cd
/path/to/thrust
/thrust/build/
ctest
```


  回显显示信息如下图所示。
