Analytics

Are you getting GPU errors while executing the Viewshed 2 tool?

The Viewshed 2 tool is a visibility analysis tool released in ArcGIS 10.3 and ArcGIS Pro 1.0. The tool takes advantage of a GPU processor by default if one is available on your computer.

As GPU graphics cards are commonly available on most of the recent computers, GPU (or CUDA) related error is likely the most common error that you may run into when the Viewshed 2 tool is used for the first time. This blog aims to explain how to resolve the most typical GPU errors that you can encounter while trying to execute the Viewshed 2 tool.

There are two types of errors:

I. GPU error at the beginning of the tool execution

When the Viewshed 2 tool just starts to execute, a GPU error occurs and the tool fails. Example error messages are as follows:

ERROR 010514: GPU exception: CUDA Exception. Driver code: CUDA_ERROR_NO_BINARY_FOR_GPU (209). ERROR 010461: GPU exception: CUDA Exception. Driver code: CUDA_ERROR_INVALID_VALUE (1).

These errors usually indicate that your GPU driver is out of date. To fix this issue, go to the NVIDIA driver update page and search for and install the latest driver for your GPU card. To take this into effect you may have to restart the computer. Rerun the Viewshed 2 tool again.

II. GPU error during the tool execution

If your computer has only one GPU card, by default it will be shared between Windows display and the Viewshed 2 analysis. In this case, the following warning message will be reported at the beginning of the tool execution:

WARNING 010453: The GPU being used is connected to your display. This may cause the computer to appear unresponsive.  The display driver may reboot the GPU if the computation takes too long.

If an individual GPU task takes longer than the number of seconds set by the Windows TdrDelay (Timeout Detection and Recovery Delay) registry key the OS may reboot the GPU. This will cause the tool to fail during tool execution. The tool may return the following error messages:

ERROR 010461: GPU exception: CUDA Exception. Driver code: CUDA_ERROR_LAUNCH_TIMEOUT (702). ERROR 010461: GPU exception: CUDA Exception. Driver code: CUDA_ERROR_LAUNCH_FAILED (719).

To fix such errors, the value of the registry key TdrDelay needs to be increased. By default, the TdrDelay key value is 2 seconds, it needs to be set to a larger value, such as 3000 seconds. This registry key is usually found under the registry path HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\GraphicsDrivers. If it does not exist, you may need to add it and set the value appropriately. Restart the computer for the change to take effect. Please take caution when modifying the system registry by either making backup or having a qualified system analyst to perform the change.

If you have more than one GPU card in your system, you may still run into this error if the tool uses the display GPU to perform analysis. To avoid this error, it is recommended to direct the analysis computation to other non-display GPU devices. Follow the given steps below to accomplish this:

  1. Add a new OS environment variable CUDA_VISIBLE_DEVICES, if it does not exist.
  2. Set the value of the environment variable CUDA_VISIBLE_DEVICES to the GPU ID (0 for the first GPU, 1 for the second GPU, etc.) that you want to use for analysis.
  3. Restart ArcMap or ArcGIS Pro application, if you are using it for the analysis.
  4. Rerun the tool again.

These are some of the common GPU errors and solutions to fix them. If the Viewshed 2 tool still fails to execute due to other GPU or CUDA issues, remember that you can always disable GPU from being used and perform the analysis using CPU only. You can do this using the following steps:

  1. Add a new OS environment variable CUDA_VISIBLE_DEVICES, if it does not exist.
  2. Set the value of the environment variable CUDA_VISIBLE_DEVICES to -1 (or a number larger than the count of GPU devices on your computer).
  3. Restart ArcMap or ArcGIS Pro application, if you are using it for the analysis.
  4. Rerun the tool again.

For more details on how to configure GPU devices for analysis, see GPU processing with Spatial Analyst.

About the author

Xuguang holds a Ph.D. in Geography from the University of Cincinnati, and a B.S. from Peking University. He is currently a Product Engineer in the Spatial Analysis and Data Science team. Xuguang has more than 10 years of experience with ArcGIS. His expertise include Raster Analysis, Geoprocessing, and Python scripting.

0 Comments
Inline Feedbacks
View all comments

Next Article

Pop-ups: the essentials

Read this article