Nvidia CUDA 运行时错误

Nvidia CUDA 运行时错误

我在 Ubuntu 16.04 上安装了 Nvidia GT630 显卡,驱动程序版本为 384.90。我成功安装了 CUDA 9 工具包。来自示例文件夹的 deviceQuery 已通过。以下是输出:

~/NVIDIA_CUDA-9.0_Samples/1_Utilities/deviceQuery$ ./deviceQuery 
./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GT 630"
  CUDA Driver Version / Runtime Version          9.0 / 9.0
  CUDA Capability Major/Minor version number:    2.1
  Total amount of global memory:                 4022 MBytes (4217110528 bytes)
MapSMtoCores for SM 2.1 is undefined.  Default to use 64 Cores/SM
MapSMtoCores for SM 2.1 is undefined.  Default to use 64 Cores/SM
  ( 2) Multiprocessors, ( 64) CUDA Cores/MP:     128 CUDA Cores
  GPU Max Clock rate:                            1400 MHz (1.40 GHz)
  Memory Clock rate:                             667 Mhz
  Memory Bus Width:                              128-bit
  L2 Cache Size:                                 131072 bytes
  Maximum Texture Dimension Size (x,y,z)         1D=(65536), 2D=(65536, 65535), 3D=(2048, 2048, 2048)
  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: 32768
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  1536
  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): (65535, 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
  Device supports Unified Addressing (UVA):      Yes
  Supports Cooperative Kernel Launch:            No
  Supports MultiDevice Co-op Kernel Launch:      No
  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 = 9.0, CUDA Runtime Version = 9.0, NumDevs = 1
Result = PASS

但是,当我尝试构建其他示例并运行它们时,出现以下运行时 API 错误 18。窗口闪烁并立即关闭。

./boxFilter Starting...

Loaded './data/lenaRGB.ppm', 1024 x 1024 pixels

Found 1 CUDA Capable device(s) supporting CUDA

Device 0: "GeForce GT 630"
  CUDA Runtime Version     :    9.0
  CUDA Compute Capability  :    2.1

Found CUDA Capable Device 0: "GeForce GT 630"
Setting active device to 0
boxFilter_kernel.cu(348) : CUDA Runtime API error 18: invalid texture reference.

其他样本如下:

simpleGL (VBO) starting...

MapSMtoCores for SM 2.1 is undefined.  Default to use 64 Cores/SM

我该如何解决这个问题?这是驱动程序安装的问题吗?

答案1

您的 GeForce GT630 拥有少于 64 个 SM 核心,SM 2.1 的 MapSMtoCores 未定义。 默认使用 64 Cores/SM 我的 310 也遇到了同样的问题,它只有 48 个核心。使用 cuda 9.0 编译程序可以正常运行,但会产生错误,并且无法执行,因为您的卡没有 64 个核心。您应该回到 cuda 8.0https://developer.nvidia.com/cuda-toolkit-archive 并从本地安装程序进行安装,这样您在升级系统时就不必返回到 cuda 9.0...如果您需要 cuda 9.0,则必须购买至少具有 64 个核心/SM 的新 nvidia 卡

希望能够有所帮助

答案2

Fermi 支持 ( CUDA Capability Major/Minor version number: 2.X) 已从 CUDA 9 中删除:http://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#unsupported-features

所以您需要回到 CUDA 8。

相关内容