在Mac OS X 10.7.4上使用OpenCL禁用Nvidia监视程序

时间:2012-06-14 05:29:54

标签: macos opencl xcode4.3 nvidia

我有一个OpenCL程序可以很好地解决小问题,但是当运行较大的问题超过8-10s在Nvidia硬件上运行内核的时间限制。虽然我没有连接到GPU上的监视器(Nvidia GTX580),但内核在运行大约8-10秒后总会被终止。

我对此问题所做的初步研究表明,如果显示器连接到显卡,Nvidia看门狗应该只执行时间限制。但是我没有连接到运行OpenCl的GPU的监视器,但仍然强制执行此限制。

是否可以禁用Nvidia监视程序或让驱动程序识别Mac OS X 10.7.4中没有监视器连接到GTX580?

我知道可能解决这个问题的方法是分解成较小的内核,但是由于我工作的性质,当我更精细的时候,我仍然可以达到这个极限。

我正在编译/运行的系统如下:

  • MacPro4,1 2 x 2.26 GHz四核英特尔至强
  • Mac OS X 10.7.4
  • XCode 4.3.3
  • Nvidia GT120(附2台监视器)
  • NVidia GTX580(无附件)

有关运行NVidia设备查询的额外信息,我得到以下输出:

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

Found 2 CUDA Capable device(s)

Device 0: "GeForce GTX 580"
  CUDA Driver Version / Runtime Version          4.2 / 4.2
  CUDA Capability Major/Minor version number:    2.0
  Total amount of global memory:                 1536 MBytes (1610285056 bytes)
  (16) Multiprocessors x ( 32) CUDA Cores/MP:    512 CUDA Cores
  GPU Clock rate:                                1564 MHz (1.56 GHz)
  Memory Clock rate:                             2004 Mhz
  Memory Bus Width:                              384-bit
  L2 Cache Size:                                 786432 bytes
  Max Texture Dimension Size (x,y,z)             1D=(65536), 2D=(65536,65535), 3D=(2048,2048,2048)
  Max Layered Texture Size (dim) x layers        1D=(16384) x 2048, 2D=(16384,16384) x 2048
  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
  Maximum sizes of each dimension of a block:    1024 x 1024 x 64
  Maximum sizes of each dimension of a grid:     65535 x 65535 x 65535
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             512 bytes
  Concurrent copy and 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
  Concurrent kernel execution:                   Yes
  Alignment requirement for Surfaces:            Yes
  Device has ECC support enabled:                No
  Device is using TCC driver mode:               No
  Device supports Unified Addressing (UVA):      Yes
  Device PCI Bus ID / PCI location ID:           6 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

Device 1: "GeForce GT 120"
  CUDA Driver Version / Runtime Version          4.2 / 4.2
  CUDA Capability Major/Minor version number:    1.1
  Total amount of global memory:                 512 MBytes (536543232 bytes)
  ( 4) Multiprocessors x (  8) CUDA Cores/MP:    32 CUDA Cores
  GPU Clock rate:                                1400 MHz (1.40 GHz)
  Memory Clock rate:                             800 Mhz
  Memory Bus Width:                              128-bit
  Max Texture Dimension Size (x,y,z)             1D=(8192), 2D=(65536,32768), 3D=(2048,2048,2048)
  Max Layered Texture Size (dim) x layers        1D=(8192) x 512, 2D=(8192,8192) x 512
  Total amount of constant memory:               65536 bytes
  Total amount of shared memory per block:       16384 bytes
  Total number of registers available per block: 8192
  Warp size:                                     32
  Maximum number of threads per multiprocessor:  768
  Maximum number of threads per block:           512
  Maximum sizes of each dimension of a block:    512 x 512 x 64
  Maximum sizes of each dimension of a grid:     65535 x 65535 x 1
  Maximum memory pitch:                          2147483647 bytes
  Texture alignment:                             256 bytes
  Concurrent copy and 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
  Concurrent kernel execution:                   No
  Alignment requirement for Surfaces:            Yes
  Device has ECC support enabled:                No
  Device is using TCC driver mode:               No
  Device supports Unified Addressing (UVA):      No
  Device PCI Bus ID / PCI location ID:           5 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 4.2, CUDA Runtime Version = 4.2, NumDevs = 2, Device = GeForce GTX 580, Device = GeForce GT 120
[deviceQuery] test results...
PASSED

> exiting in 3 seconds: 3...2...1...done!

1 个答案:

答案 0 :(得分:0)

我前段时间一直在寻找这个问题的答案......我从来没有找到解决方案。

但这无论如何都不应该“解决” 如果用户只有一个GPU,你会怎么做?让用户PC只需冻结10秒以上?这将是一个有趣的软件... ...

我将它拆分为多个子内核,或者如果你的内核中有一个循环,你也可以为每个内核执行一次迭代。只需将当前迭代器值保存到缓冲区,然后在下次执行时从该点重新启动。

这应该适用于您的应用程序,因为它似乎不像某种游戏那样的实时应用程序。