当前位置:网站首页>Install cuda+cusp environment and create the first helloword starter project
Install cuda+cusp environment and create the first helloword starter project
2022-06-13 07:45:00 【Xiao Feng, senior student, big bang】
Catalog
install CUDA Environmental Science
It's common to report mistakes
nvcc fatal : Cannot find compiler 'cl.exe' in PATH
CUDA Programming tutorial series
establish HelloWord engineering
cusp Calculation library installation
install CUDA Environmental Science
You can refer to the tutorial : Nanny level CUDA Download, install and use , Detailed environment variable configuration , Not only will you be able to install , It will also teach you to understand why to install like this - You know
You can also refer to the official website :https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html
Installation environment , first Helloword Refer to the following section for the project .
It's common to report mistakes
nvcc fatal : Cannot find compiler 'cl.exe' in PATH
You can refer to this article :https://blog.csdn.net/qq_40993412/article/details/81454531
CUDA Programming tutorial series
Start from scratch ,CUDA The engineering structure is described in detail :
GPU Self taught programming 1 —— introduction _shuzfan The blog of -CSDN Blog
CUDA From introduction to Mastery Course :
【CUDA Development 】CUDA From entry to mastery _Zhang_P_Y The blog of -CSDN Blog _cuda Development
establish HelloWord engineering
The following is the first project creation step in more detail :
1、 open visual studio, New projects , choice cuda



Automatically created “kernel.cu” file , It's a classic Vector addition Of GPU Program , We don't need to , So it will main Code comments in functions . Then add your own code :
#include <iostream>
__global__ void mkernel(void){}
int main()
{
mkernel <<<1,1>>>();
std::cout<<"Hello, World!"<<std::endl;
system("pause");
return 0;
}And then run , You get the result


Specific structure analysis , You can see it 《GPU Self taught programming 》 series .
cusp Calculation library installation
Some students will also use cusp library , Because it's just a library file , Therefore, there is no need to compile , Easy to install .
Official website :CUSP: Quick Start Guide (cusplibrary.github.io)
First, according to the first section above “ install CUDA Environmental Science ” Complete the environment installation .
Download the source code :
Official warehouse , Pay attention to use develop Branch , Otherwise, when cuda Greater than version 9 after , Error will be reported in compilation :cusplibrary/cusplibrary: CUSP : A C++ Templated Sparse Matrix Library (github.com)
https://github.com/cusplibrary/cusplibrary
Pay attention to the direct selection “code - download ZIP”!!!

When the download is complete , Refer to official documentation , take cusp Put the folder in :

My computer win11 The path is :C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\include
Then you can refer to the above “ establish HelloWord engineering ” section , Reference in project , No need for extra operation :
#include <cusp/coo_matrix.h>
#include <cusp/csr_matrix.h>
#include <cusp/dia_matrix.h>
#include <cusp/ell_matrix.h>
#include <cusp/hyb_matrix.h>
#include <cusp/print.h>
#include <cusp/io/matrix_market.h>
#include <iostream>
#include <cusp/array1d.h>
#include <cusp/array2d.h>
#include <cusp/multiply.h>
#include <chrono>
It's common to report mistakes
thrust blocking.h No such file or directory
Try to lower cuda Try the version , Put on a cuda toolkit 10, And then up there cusp choice cuda10 Branch .
边栏推荐
- C语言:如何给全局变量起一个别名?
- Clickhouse column basic data type description
- Redis learning journey master-slave replication
- mysql面试题
- Adding certificates to different systems
- Socket programming 2:io reuse (select & poll & epoll)
- LATERAL VIEW explode
- A. Vacations (DP greed
- v-for生成的子组件列表删除第n行出现数据错乱问题
- 19 | establish data path (bottom): instruction + operation =cpu
猜你喜欢

平衡二叉树学习笔记------一二熊猫

Redis Cluster - the underlying principle of cluster execution commands

安装CUDA+CUSP环境,并创建第一个HelloWord入门工程

MySQL Gtid_ Executed and gtid_ Purged modification time

Selenium reports an error deprecationwarning: executable_ path has been deprecated, please pass in a Service object

Redis underlying data structure - underlying principle of hash table

21 | 面向流水线的指令设计(下):奔腾4是怎么失败的?

Mui mixed development - when updating the download app, the system status bar displays the download progress

26 | superscalar and VLIW: how to make the CPU throughput exceed 1

在排序数组中查找元素的第一个和最后一个位置
随机推荐
Socket programming 2:io reuse (select & poll & epoll)
Login registration
21 | 面向流水线的指令设计(下):奔腾4是怎么失败的?
力扣(LeetCode)163. 缺失的区间(2022.06.12)
[redis problem] record a big key problem handling
Logback log framework learning and problems
Export chrome plug-ins and import local plug-ins to chrome
First graphical interface
【clickhouse专栏】基础数据类型说明
P1434 [show2002] skiing (memory search
21 | pipeline oriented instruction design (Part 2): How did Pentium 4 fail?
How app inventor accesses resource files in assets directory
Redis' underlying data structure -- SDS
[log4j2 log framework] modify dump log file permissions
Awk use
Database outline
在排序数组中查找元素的第一个和最后一个位置
不同系统添加证书
Selenium reports an error deprecationwarning: executable_ path has been deprecated, please pass in a Service object
2022 electrician (elementary) examination questions and simulation examination