Cuda 示例正常工作,但我的代码显示没有功能的设备
Cuda samples working but my code shows no capable device?
我正在尝试运行以下代码:
void wrapper(double *h_res, const double *h_em, const double *h_obs)
{
double *dev_res = 0;
double *dev_em = 0;
double *dev_obs = 0;
int dc;
cudaGetDeviceCount(&dc);
cout << "Device count: " << dc << endl;
}
同样适用于:
cudaStatus = cudaSetDevice(0);
if (cudaStatus != cudaSuccess)
{
cerr << "cudaSetDevice failed! Do you have a CUDA-capable GPU installed?" << endl;
goto Error;
}
我得到Device count: 0
或cudaSetDevice failed! Do you have a CUDA-capable GPU installed?
现在,当我尝试运行 6.5 提供的 deviceQuery 示例时,我得到以下结果:
Detected 1 CUDA Capable device(s)
Device 0: "GeForce GT 740M"
CUDA Driver Version / Runtime Version 7.0 / 6.5
CUDA Capability Major/Minor version number: 3.0
Total amount of global memory: 2048 MBytes (2147483648 bytes)
( 2) Multiprocessors, (192) CUDA Cores/MP: 384 CUDA Cores
GPU Clock rate: 895 MHz (0.89 GHz)
Memory Clock rate: 901 Mhz
Memory Bus Width: 128-bit
L2 Cache Size: 262144 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 1 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
CUDA Device Driver Mode (TCC or WDDM): WDDM (Windows Display Driver Model)
Device supports Unified Addressing (UVA): No
Device PCI Bus ID / PCI location ID: 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 7.0, CUDA Runtime Version = 6.5, NumDevs = 1, Device0 = GeForce GT 740M
Result = PASS
我该如何解决这个问题?我拥有华硕N56VB,如果这会有任何帮助...
我最终所做的是更新我的图形驱动程序,一切都解决了。
相关文章:
- 为什么在C的循环中使用printf的Rust代码不显示输出,而在C++的循环中显示std::cout
- 我是 c++ 的新手.学习基本知识后,我想做井字游戏.对于印刷板,我在下面写代码,但它显示错误
- Clion显示错误,但可以使用Cmake成功构建代码
- 代码使用向量成功运行,但使用数组显示错误
- 这两个代码片段相似,但显示的结果不同
- 与clang++一起使用的VS代码在构建良好的C++文件中显示错误
- 代码未在联机编译器上显示结果
- 程序显示以退出代码 0; 结束
- 任何人都可以弄清楚这段代码如何显示运行错误?它打印无限时间 -1 以及正确答案
- 为什么我的代码块上没有显示输出?
- Qt GUI使用Qfiledialogbox和qlabel显示视频,这是我的代码
- 执行此代码时,它不显示任何输出.为什么?
- 当我选择大于 720 的矩阵大小时,程序退出并显示错误代码.可能是什么原因?
- 为什么此代码中显示"*** stack smashing detected ***: <unknown> terminated Aborted (core dumped) "错误?
- objdump 不显示机器代码,但显示 ASM
- 引入参数化构造函数后显示 LNK 2019 未解析外部符号的代码错误
- 为什么当我在 c++ 中运行函数时,我的代码显示数字 53
- 我只是在寻找模板,在我的书中找到了这段代码,这显示了隔离错误?
- 我的代码厨师提交显示错误的结果
- 删除矢量显示代码 c++ 段时答案更改