如果 NVIDIA 控制面板设置计算优化,cuCtxCreate 会失败

cuCtxCreate fails if NVIDIA control panel sets optimization for computing

我通过 JCuda 运行 CUDA API。当我使用 NVIDIA 控制面板为参与的 JVM 可执行文件 (java.exe) 设置计算优化(默认情况下关闭)时,程序无法在对 cuCtxCreate 的调用中创建上下文。

为了优化出发,程序运行还行。唯一的问题是内核运行时间 (~50%) 与 运行 运行 的偏差太大。我一直在寻找以垄断模式获得 CUDA 核心的方法,只是为了获得更稳定的结果。

我是否误解了控制面板中的这个参数?

Exception in thread "main" jcuda.CudaException: CUDA_ERROR_UNKNOWN at jcuda.driver.JCudaDriver.checkResult(JCudaDriver.java:353) at jcuda.driver.JCudaDriver.cuCtxCreate(JCudaDriver.java:1606) at com.varankin.cuda.CudaContext.(CudaContext.java:21)

配置:

For optimization set off, the program runs just fine. The only problem was too high deviation of elapsed time in the kernel (~50%) from run to run.

这可能是由 WDDM 驱动程序批处理计算命令引起的,如果您四处搜索,您会发现一些建议,您可以尝试将其负面影响降至最低。

I was searching for ways to get CUDA cores in something like monopoly mode, just to get more stable result.

只有在 Windows 上使用 TCC 模式的 Tesla 和某些 Quadro GPU 才存在这种操作模式。您的 GPU 不能以这种方式使用。

Do I misunderstand this parameter in control panel?

是的。引用文档:

Windows 10, Maxwell GPUs and later.
Offers significant improvement for some Compute applications.
Care should be taken when turning this setting ON, as there can
be unpredictable effects with some applications and graphics features.

给出那个警告,安全的做法是离开那个出发点。