setting cudaDeviceProperty: cudaKernelExecTimeoutEnabled
Is it possible to set the device property cudaKernelExecTimeoutEnabled
to 0 at runtime? Currently it is 1 because I'm开发者_开发问答 also running an X-server on it. The problem is, that my threads time out.
On Linux, you can disable the timeout (about 6 to 7 seconds for me) by adding an option to your X11 configuration. On modern Linux systems, there is no X11 configuration any more, everything is autodetected, but you can create it manually:
mkdir -p /etc/X11/xorg.conf.d
touch /etc/X11/xorg.conf.d/20-nvidia.conf
Then add the following into this file:
Section "Device"
Identifier "My GPU"
Driver "nvidia"
Option "Interactive" "0"
EndSection
The key here is the "Interactive" option. This works for me even without X11 restart. It was obvious that this configuration is read and applied as soon as my OpenCL application is started.
"Identifier" can be an arbitrary value. "Driver" is "nvidia" in my case, since I'm using the proprietary Nvidia driver for Linux (part of the official Debian package repositories).
I am assuming you are on windows:
You need to disable the windows driver timeout:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Watchdog\Display\DisableBugCheck
create a REG_DWORD and set it to 1.
On Linux, you need to use the nvidia-smi
command to change properties of the device. But I think if you're running a display on the GPU, you might not be able to set that property.
精彩评论