deviceQuery cuda程序示例 [英] Sample deviceQuery cuda program
问题描述
我有一台配置了NVIDIA GeForce1080 GTX和CentOS 7作为操作系统的Intel Xeon机器。我已经安装了NVIDIA驱动程序410.93和cuda-toolkit 10.0。编译cuda-samples之后,我尝试运行./deviceQuery。
但是它会这样抛出
./ deviceQuery开始...
CUDA设备查询(运行时API)版本(CUDART静态链接)
cudaGetDeviceCount返回30
->错误未知
结果=失败
某些命令输出
lspci | grep VGA
01:00.0 VGA兼容控制器:NVIDIA Corporation GP104 [GeForce GTX 1080](rev a1)
nvidia-smi
2019年2月13日星期三16:08:07
+ ------------------------ -------------------------------------------------- --- +
| NVIDIA-SMI 410.93驱动程序版本:410.93 CUDA版本:10.0 |
| ------------------------------- + ------------- --------- + ---------------------- +
| GPU名称持久性-M |总线编号Disp.A |挥发性不佳。 ECC |
|风扇温度性能:用法/上限|内存使用| GPU实用计算M。
| ================================ + ============ ========= + ===================== |
| 0 GeForce GTX 1080关闭| 00000000:01:00.0开| N / A |
| 0%54C P0 46W / 240W | 175MiB / 8119MiB | 0%默认|
+ ------------------------------- + ------------- --------- + ---------------------- +
+ -------- -------------------------------------------------- ------------------- +
|进程:GPU内存|
| GPU PID类型进程名称用法|
| ============================================= =============================== |
| 0 6275 G / usr / bin / X 94MiB |
| 0 7268 G / usr / bin / gnome-shell 77MiB |
+ --------------------------------------------- -------------------------------- +
nvcc --version
nvcc:NVIDIA (R)Cuda编译器驱动程序
版权所有(c)2005-2018 NVIDIA Corporation
基于Sat_Aug_25_21:08:01_CDT_2018
Cuda编译工具,版本10.0,V10.0.13
PATH& LD_LIBRARY_PATH
PATH = / usr / local / cuda-10.0 / bin:/ usr / local / cuda / bin :/ usr / local / bin:/ usr / local / sbin:
LD_LIBRARY_PATH = /usr/local/cuda-10.0/lib64:/usr/local/cuda/lib64:
lsmod | grep nvidia
nvidia_drm 39819 3
nvidia_modeset 1036573 6 nvidia_drm
nvidia 16628708 273 nvidia_modeset
drm_kms_helper 179394 1 nvidia_drm
drm 429744 6 drm_kms_helper,nvidia_drm
ipmi_msghandler 56032 2 ipmi_devintf,nvidia
lsmod | grep nvidia-uvm
无输出
dmesg | grep NVRM
[8.237489] NVRM:加载NVIDIA UNIX x86_64内核模块410.93 Thu Dec 20 20:01:16 CST 2018(使用线程中断)
此问题是否与modprobe或nvidia-uvm有关?
我在NVIDIA-devtalk论坛上问了这个问题,但是还没有答复。
请提供一些建议。
预先感谢。
我调试了它。问题是nvidia-driver(410.93)和cuda之间的版本不匹配(cuda运行文件附带驱动程序410.48)。 Gave自动删除了所有驱动程序,并从头开始重新安装。删除/ var / lib / dkms / nvidia / *中的所有链接文件。
现在工作正常。
lsmod | grep nvidia
nvidia_uvm 786031 0
nvidia_drm 39819 3
nvidia_modeset 1048491 6 nvidia_drm
nvidia 16805034 274 nvidia_modeset,nvidia_uvm
drm_kms_helper 179394 1 nvidia_drm
drm 429744 6 drm_kms_helper,nvidia_drm
ipmi_msghandler 56032 2 ipmi_devintf $ c $ $pre>
nvidia-smi
星期五2019年2月15日11:46:24
+ ------------------------------------- ---------------------------------------- +
| NVIDIA-SMI 410.48驱动程序版本:410.48 |
| ------------------------------- + ------------- --------- + ---------------------- +
| GPU名称持久性-M |总线编号Disp.A |挥发性不佳。 ECC |
|风扇温度性能:用法/上限|内存使用| GPU实用计算M。
| ================================ + ============ ========= + ===================== |
| 0 GeForce GTX 1080关闭| 00000000:01:00.0开| N / A |
| 0%45C P8 10W / 240W | 242MiB / 8119MiB | 0%默认|
+ ------------------------------- + ------------- --------- + ---------------------- +
+ -------- -------------------------------------------------- ------------------- +
|进程:GPU内存|
| GPU PID类型进程名称用法|
| ============================================= =============================== |
| 0 6063 G / usr / bin / X 120MiB |
| 0 7502 G / usr / bin / gnome-shell 119MiB |
+ --------------------------------------------- -------------------------------- +
nvcc -V
nvcc:NVIDIA( R)Cuda编译器驱动程序
版权所有(c)2005-2018 NVIDIA Corporation
构建于Sat_Aug_25_21:08:01_CDT_2018
Cuda编译工具,版本10.0,V10.0.130
./ deviceQuery
./ deviceQuery起始...
CUDA设备查询(运行时API)版本(CUDART静态链接)
检测到1个支持CUDA的设备
设备0: GeForce GTX 1080
CUDA驱动程序版本/运行时版本10.0 / 10.0
CUDA功能主要/次要版本号:6.1
全球总量内存:8119 MBytes(8513585152 bytes)
(20)多处理器,(128)CUDA核心/ MP:2560 CUDA核心
GPU最大时钟频率:1797 MHz(1.80 GHz)
内存C锁定率:5005 Mhz
内存总线宽度:256位
L2高速缓存大小:2097152字节
最大纹理尺寸大小(x,y,z)1D =(131072),2D =( 131072、65536),3D =(16384、16384、16384)
最大分层1D纹理大小(数量)1D =(32768),2048层
最大分层2D纹理大小(数量) 2D =(32768,32768),2048层
恒定内存总数:65536字节
每个块的共享内存总数:49152字节
每个块可用的寄存器总数:65536
线程大小:32
每个多处理器的最大线程数:2048
每个块的最大线程数:1024
线程块的最大尺寸(x,y,z): (1024、1024、64)
网格大小的最大尺寸(x,y,z):(2147483647、65535、65535)
最大内存间距: 2147483647字节
纹理对齐:512字节
并发复制和内核执行:是,具有2个复制引擎
内核运行时间限制:是
集成GPU共享主机内存:否
支持主机页面锁定的内存映射:是
Surfaces的对齐要求:是
设备具有ECC支持:禁用
设备支持统一寻址(UVA):是
设备支持计算抢占:是
支持协作内核启动:是
支持多设备协作内核启动:是
设备PCI域ID /总线ID /位置ID:0/1/0
计算模式:
<默认值(多个主机线程可以同时将:: cudaSetDevice()与设备一起使用)>
deviceQuery,CUDA驱动程序= CUDART,CUDA驱动程序版本= 10.0,CUDA运行时版本= 10.0,NumDevs = 1
结果=通过
I have a Intel Xeon machine with NVIDIA GeForce1080 GTX configured and CentOS 7 as operating system. I have installed NVIDIA-driver 410.93 and cuda-toolkit 10.0. After compiling the cuda-samples, i tried to run ./deviceQuery.
But it throws like this
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 30
-> unknown error
Result = FAIL
some command outputs
lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1080] (rev a1)
nvidia-smi
Wed Feb 13 16:08:07 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.93 Driver Version: 410.93 CUDA Version: 10.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1080 Off | 00000000:01:00.0 On | N/A |
| 0% 54C P0 46W / 240W | 175MiB / 8119MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 6275 G /usr/bin/X 94MiB |
| 0 7268 G /usr/bin/gnome-shell 77MiB |
+-----------------------------------------------------------------------------+
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.13
PATH & LD_LIBRARY_PATH
PATH =/usr/local/cuda-10.0/bin:/usr/local/cuda/bin:/usr/local/bin:/usr/local/sbin:
LD_LIBRARY_PATH = /usr/local/cuda-10.0/lib64:/usr/local/cuda/lib64:
lsmod | grep nvidia
nvidia_drm 39819 3
nvidia_modeset 1036573 6 nvidia_drm
nvidia 16628708 273 nvidia_modeset
drm_kms_helper 179394 1 nvidia_drm
drm 429744 6 drm_kms_helper,nvidia_drm
ipmi_msghandler 56032 2 ipmi_devintf,nvidia
lsmod | grep nvidia-uvm
no output
dmesg | grep NVRM
[ 8.237489] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 410.93 Thu Dec 20 17:01:16 CST 2018 (using threaded interrupts)
Is this problem anything related to modprobe or nvidia-uvm?
I asked this in NVIDIA-devtalk forum, but no-reply yet.
Please give some suggestions.
Thanking in advance.
解决方案 I debugged it. The problem is version mismatch between nvidia-driver(410.93) and cuda(with driver 410.48 came with cuda run file). Gave autoremove all the drivers and reinstalled from the beginning. Deleted all the link files in /var/lib/dkms/nvidia/*.
Now it works fine. And nvidia-uvm also loaded.
lsmod | grep nvidia
nvidia_uvm 786031 0
nvidia_drm 39819 3
nvidia_modeset 1048491 6 nvidia_drm
nvidia 16805034 274 nvidia_modeset,nvidia_uvm
drm_kms_helper 179394 1 nvidia_drm
drm 429744 6 drm_kms_helper,nvidia_drm
ipmi_msghandler 56032 2 ipmi_devintf,nvidia
nvidia-smi
Fri Feb 15 11:46:24 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.48 Driver Version: 410.48 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 1080 Off | 00000000:01:00.0 On | N/A |
| 0% 45C P8 10W / 240W | 242MiB / 8119MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 6063 G /usr/bin/X 120MiB |
| 0 7502 G /usr/bin/gnome-shell 119MiB |
+-----------------------------------------------------------------------------+
nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
./deviceQuery
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "GeForce GTX 1080"
CUDA Driver Version / Runtime Version 10.0 / 10.0
CUDA Capability Major/Minor version number: 6.1
Total amount of global memory: 8119 MBytes (8513585152 bytes)
(20) Multiprocessors, (128) CUDA Cores/MP: 2560 CUDA Cores
GPU Max Clock rate: 1797 MHz (1.80 GHz)
Memory Clock rate: 5005 Mhz
Memory Bus Width: 256-bit
L2 Cache Size: 2097152 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 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 2 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
Device supports Unified Addressing (UVA): Yes
Device supports Compute Preemption: Yes
Supports Cooperative Kernel Launch: Yes
Supports MultiDevice Co-op Kernel Launch: Yes
Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.0, CUDA Runtime Version = 10.0, NumDevs = 1
Result = PASS
这篇关于deviceQuery cuda程序示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!