The RStudio IDE comes with a new rendering engine based on the same technology as Chromium, and attempts to make use of hardware accelerated rendering when possible. In most cases, this will imply vastly improved rendering and editing performance relative to previous releases of the RStudio IDE. Unfortunately, due to the vast heterogeneity in the quality of drivers and graphics cards across different systems, rendering issues can arise when using RStudio. For example, some users have seen:
- RStudio rendering 'offset' from its true location in the RStudio window;
- RStudio crashes, with device driver routines shown in the stack trace;
- Rendering 'glitches', where bands of shapes of color may flash inappropriately at rare intervals.
This article will describe some of the available remedies for such issues.
Software Rendering
While software rendering can often be slower, it is the most reliable of the different rendering engines. You can enable software rendering in a couple ways.
Within Tools -> Global Options... -> General -> Advanced, the rendering engine can be explicitly toggled. (The changes will take effect after restarting RStudio.)
If you're unable to access the Global Options pane (for example, because RStudio only displays as a white screen on launch), you can also try launching RStudio from a terminal with the GPU disabled. For example:
# macOS
export RSTUDIO_CHROMIUM_ARGUMENTS="--disable-gpu"
/Applications/RStudio.app/Contents/MacOS/RStudio
# Linux
export RSTUDIO_CHROMIUM_ARGUMENTS="--disable-gpu"
/usr/lib/rstudio/bin/rstudio
Note that launching RStudio in this way will only disable GPU rendering for that particular RStudio session (that is, only for RStudio sessions that see that environment variable active). If you'd like to make this change more permanently, you can directly modify RStudio Desktop's options file. The option file is located at:
# macOS
$HOME/Library/Preferences/com.rstudio.desktop.plist
# Linux
~/.config/RStudio/desktop.info # $XDG_CONFIG_HOME/RStudio/desktop.ini
# Windows
%APPDATA%\Roaming\RStudio\desktop.ini
In each case, you can modify the entry called desktop.renderingEngine and set it to software to force software rendering. For example:
[General]
desktop.renderingEngine=software
Finally, on Windows, you can hold down the Ctrl key while launching RStudio. You will be presented with a dialog allowing you to select a version of R, as well as the rendering engine to use when RStudio is launched.
Advanced GPU-related Toggles
We have had some reports of RStudio crashes related to the current display driver running. While software rendering may be a panacea for these issues, you may find the performance unacceptable on your machine. In these cases, you can also try toggling the GPU-related options in the Advanced preferences pane. Within Tools -> Global Options... -> General -> Advanced, the two options:
[x] Use GPU blacklist (recommended)
[x] Use GPU driver bug workarounds (recommended)
can be toggled off, as in some cases system performance is more reliable without these remedies active.
Reporting Issues
If you're running into an issue with RStudio, feel free to get in touch with us on the community forums and an IDE team member or community member will do their best to help diagnose the issue.
Comments