当前位置:网站首页>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 .
边栏推荐
- Adding certificates to different systems
- v-for生成的子组件列表删除第n行出现数据错乱问题
- China phosphate market in-depth analysis and investment prospect forecast report 2022-2028
- Mui mixed development - when updating the download app, the system status bar displays the download progress
- P6154 wandering (memory search
- A. Vacations (DP greed
- Tidb certification guide PCTA Pctp
- IDS persistence ---rdb
- leetcode 咒语和药水的成功对数
- Redis learning journey -- do you know the data types of redis?
猜你喜欢
23 | 冒险和预测(二):流水线里的接力赛
Login registration
Selenium foundation API
First graphical interface
Redis learning journey - transaction
Logback log framework learning and problems
Redis Cluster - the underlying principle of slot assignment
18 | 建立数据通路(中):指令+运算=CPU
Redis learning journey master-slave replication
Redis Cluster - the underlying principle of cluster execution commands
随机推荐
China phosphate market in-depth analysis and investment prospect forecast report 2022-2028
JMeter common commands
[MySQL] the most complete MySQL monitoring project
How idea breaks point debugging
11.29 Li Kou swipes questions every day
SFTP login and download file script
26 | Superscalar和VLIW:如何让CPU的吞吐率超过1
[Yu Yue education] econometrics reference materials of Jiujiang University
[log4j2 log framework] sensitive character filtering
2021-10-08
19 | establish data path (bottom): instruction + operation =cpu
A. Vacations (DP greed
String source code analysis
Redis learning journey -- getting to know redis for the first time
How app inventor accesses resource files in assets directory
关于#etl#的问题:io.trino.jdbc.TrinoDriver
Data warehouse data processing and data flow
21 | 面向流水线的指令设计(下):奔腾4是怎么失败的?
20 | 面向流水线的指令设计(上):一心多用的现代CPU
Success logarithm of leetcode spells and potions