Generate Stimulus without a monitor over SSH in VS Code

Hi,

I would like to use the grating stim module to generate a drifting grating that is masked by gabors. I can do this locally without issue however my development environment is primarily in VS Code over SSH. When I try to simply import the visual module I get the error:

NoSuchDisplayException: Cannot connect to “None”

I don’t plan to use a window to view the stimulus remotely, rather my intention is to export the frames to a video file using getMovieFrame

Running on Ubuntu 20.04 LTS python3.11.

A few suggestions:

  1. Xvfb trick it into thinking there is an xserver
  2. if the remote system has X, ssh from remote to local
    with ssh -Y -c
  3. use a variant of VNC

I need a bit more info on your setup.

Hi Ben,

Thanks for your suggestions. What else do you need to know about my setup?

I’ve tried but not had much luck with xvfb to initialize a display.

I should have X but I cannot use that shh command to connect through vscode.

VNC is off-limits to me, I have to do a jump in order to reach my development machine.

After some further tinkering, pyvirtualdisplay seems to the be answer to get this to work I don’t have saveMovieFrames working quite yet however this is enough to enable imports of the visual module to work.