Error in RStudioGD(): Shadow graphics device error

Hi Jeff,

I am just gearing up on the RStudio app deployment. I have encountered an error when trying to plots things on the RStudio windows gui that is prompted with the interactive sessions.
any plotting results in an error:
Error in RStudioGD(): Shadow graphics device error: r error 4 (R code execution error)

On the same instance, if I open a terminal and type “rstudio” there, the new window that will pop up works just fine for plotting purposes.

Is this sth you encountered or have any info that can help?
Wondering if there is an environmental variable that needs to be added to the submit file to avoid such an error on the initial RStudio prompt?

I’m not familiar with that, but googling it shows a lot of results. Do you have any other errors, like maybe this ticket in the rstudio github?

There could be an issue with the container you’re running it in (if you’re indeed running it in a container) or how you’ve mounted the /tmp directory in it.

Thanks for your quick response. Our case is bare-metal installation and tmp is accessible. Yeah I am not sure if that’s an installation issue on the RStudio side since I can get the plot graphics when I open a terminal on the same interactive session xcfs.
Seems like an environmental variable is defined differently when rstudio is called through ondemand vs xcfs terminal…

Yea it looks like we run rstudio/1.1.380_server. While trying to get version 1.3 I ran into a lot of X11 type issues.

We also have a lot of X11 libraries like /usr/lib/ (just as an example) aren’t behind a module. Remember that OOD is just using a shell script through your scheduler. So you may be on to something where bash/ssh do something (to your LD_LIBRARY_PATH) that isn’t enabled during the Rstudio job.

Would it be possible to instruct OOD to open the xfcs terminal first, then run rstudio through modules? (Does that make sense?)

Hey sorry for the delay in circling back. I don’ think you can open the terminal then run the command.

Did you ever solve this? If not feel free to add the full stack trace if you have it. I can’t tell just by the one line what the issue may be. That Github ticket seems to indicate that issue was with directories, but this issue may be something different.


You can, of course, have people start the Remote Desktop application, then from it start the RStudio desktop application from the terminal. I am pretty sure that you could preload any modules needed for the session and add something to start a Terminal window so that it is there already when the user gets to the Desktop. You should also be able to provide a Desktop launcher for RStudio desktop, if you wanted.

That would be quite different from the RStudio application, though, so perhaps that is not what you want.

At OSC we provide access to RStudio Server instead of the RStudio GUI app. But I tried something similar with the Paraview app where we do:

# Load the required environment
module load xalt/latest intel/16.0.3 virtualgl <%= context.version %>

# Output debug info
module list

# Launch ParaView
set -x
vglrun paraview

as an experiment I changed this to

# Start Paraview
module load xalt/latest intel/16.0.3 virtualgl paraview/5.8.0

xfce4-terminal --command='vglrun paraview'
wait $!

And this was the result:

So maybe the command that actually launches the RStudio GUI you could start by passing that command to xfce4-terminal --command=''.