Skip to content

rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7

10 messages · Tom Callaway, Wittner, Ben, Ph.D.

#
Dear R-SIG-Fedora,

I'm finding that on CentOS 7, rgl.snapshot (a function in the R package rgl, which provides an R interface to the OpenGL 3-d graphics library) only captures a small portion what's visible in the RGL device window. This does not happen with the same R and rgl versions on CentOS 5.3 (see details below).

The maintainer of rgl, Duncan Murdoch, responded (see below) that the rgl code has not changed in a long time, so it's likely, although not certain, that the problem lies with CentOS 7.

I know very little about graphics, but it seems to me from looking at the rgl source code that the fundamental work of rgl.snapshot is done by calls to glReadBuffer, glPixelStorei, and glReadPixels, which seem to be functions in the OpenGL library.

Can anyone take a look at this or advise me on how to proceed?

Thanks very much in advance.

-Ben

-----Original Message-----
From: Duncan Murdoch [mailto:murdoch.duncan at gmail.com] 
Sent: Friday, January 08, 2016 8:13 PM
To: Wittner, Ben, Ph.D.; r-help at r-project.org
Subject: Re: [R] rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7
On 08/01/2016 4:13 PM, Wittner, Ben, Ph.D. wrote:
I think you'll need to contact CentOS about this.  That code hasn't changed in rgl in a long time.  It's possible that rgl is wrong, but I'd need more information from them to convince me.

Duncan Murdoch



The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.png
Type: image/png
Size: 968 bytes
Desc: test.png
URL: <https://stat.ethz.ch/pipermail/r-sig-fedora/attachments/20160111/ddb795d6/attachment.png>
#
On 01/11/2016 10:55 AM, Wittner, Ben, Ph.D. wrote:
Are you using the EPEL R 3.2.3 builds? What version of Centos 7? 7.2? Is
the NVIDIA driver in play? What version of the NVIDIA driver are you using?

~tom

==
Red Hat
#
Dear Tom, Thank you very much for thinking about this. Please see my replies below. -Ben
I'm not sure what the question means, but I'm pretty sure the answer is no. I know I built the versions of R I used from source code (i.e., ./configure followed by make).
[bwittner at kagoshima ~]$ cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core) 
[bwittner at kagoshima ~]$ rpm -q centos-release
centos-release-7-2.1511.el7.centos.2.10.x86_64
[bwittner at kagoshima ~]$ uname -rmi
3.10.0-327.3.1.el7.x86_64 x86_64 x86_64
I think so. When I execute the command lspci -v, the only block that has mention of VGA is the following:

07:00.0 VGA compatible controller: NVIDIA Corporation G84GL [Quadro FX 370] (rev a1) (prog-if 00 [VGA controller])        
        Subsystem: NVIDIA Corporation Device 0491                                                                         
        Flags: bus master, fast devsel, latency 0, IRQ 42                                                                 
        Memory at df000000 (32-bit, non-prefetchable) [size=16M]                                                          
        Memory at c0000000 (64-bit, prefetchable) [size=256M]                                                             
        Memory at dc000000 (64-bit, non-prefetchable) [size=32M]                                                          
        I/O ports at dc00 [size=128]                                                                                      
        Expansion ROM at defe0000 [disabled] [size=128K]                                                                  
        Capabilities: <access denied>                                                                                     
        Kernel driver in use: nouveau
Since the output of lspci above said "Kernel driver in use: nouveau", I executed the command modinfo nouveau, getting the following output:

filename:       /lib/modules/3.10.0-327.3.1.el7.x86_64/kernel/drivers/gpu/drm/nouveau/nouveau.ko
license:        GPL and additional rights
description:    nVidia Riva/TNT/GeForce/Quadro/Tesla
author:         Nouveau Project
rhelversion:    7.2
srcversion:     C131306B4DEC7AB88BC647D
alias:          pci:v000012D2d*sv*sd*bc03sc*i*
alias:          pci:v000010DEd*sv*sd*bc03sc*i*
depends:        drm,drm_kms_helper,ttm,mxm-wmi,i2c-core,wmi,video,i2c-algo-bit
intree:         Y
vermagic:       3.10.0-327.3.1.el7.x86_64 SMP mod_unload modversions 
signer:         CentOS Linux kernel signing key
sig_key:        3D:4E:71:B0:42:9A:39:8B:8B:78:3B:6F:8B:ED:3B:AF:09:9E:E9:A7
sig_hashalgo:   sha256
parm:           tv_norm:Default TV norm.
		Supported: PAL, PAL-M, PAL-N, PAL-Nc, NTSC-M, NTSC-J,
			hd480i, hd480p, hd576i, hd576p, hd720p, hd1080i.
		Default: PAL
		*NOTE* Ignored for cards with external TV encoders. (charp)
parm:           vram_pushbuf:Create DMA push buffers in VRAM (int)
parm:           nofbaccel:Disable fbcon acceleration (int)
parm:           tv_disable:Disable TV-out detection (int)
parm:           ignorelid:Ignore ACPI lid status (int)
parm:           duallink:Allow dual-link TMDS (default: enabled) (int)
parm:           pstate:enable sysfs pstate file, which will be moved in the future (int)
parm:           config:option string to pass to driver core (charp)
parm:           debug:debug string to pass to driver core (charp)
parm:           noaccel:disable kernel/abi16 acceleration (int)
parm:           modeset:enable driver (default: auto, 0 = disabled, 1 = enabled, 2 = headless) (int)
parm:           runpm:disable (0), force enable (1), optimus only default (-1) (int)
parm:           agpmode:AGP mode (0 to disable AGP) (int)




The information in this e-mail is intended only for the ...{{dropped:11}}
#
On 01/11/2016 01:24 PM, Wittner, Ben, Ph.D. wrote:
Okay. I do "official" package builds of R for RHEL/CentOS as part of the
EPEL repository:

https://fedoraproject.org/wiki/EPEL

If its not painful for you to do so, testing my packages vs yours just
to rule out misconfiguration in R would be helpful. I don't think this
is likely, but I'm being thorough.
Okay. Nouveau is _not_ the NVIDIA driver, that's the open source driver
provided by the Linux kernel. It is possible this is a bug in nouveau.
You may want to try to install the NVIDIA driver and see if it resolves
your issue:

http://www.nvidia.com/object/unix.html

~tom

==
Red Hat
#
Tom,
I've now tried the EPEL version of R and it still has the problem.
I started trying to do this, but I'm stuck.
I started with http://us.download.nvidia.com/XFree86/Linux-x86_64/340.96/README/installdriver.html , which led me to http://us.download.nvidia.com/XFree86/Linux-x86_64/340.96/README/commonproblems.html#nouveau . I created /etc/modprobe.d/disable-nouveau.conf as instructed then rebooted, but the nvidia installer found the nouveau driver running anyway, so it wrote two more .conf files (one in /usr/lib/modproe.d and the other in /etc/modeprobe.d) and then halted. I rebooted and tried the installer again, but again it noticed the nouveau driver running.
I suspect this is because the initial ramdisk image contains Nouveau because, even though I've done systemctl set-default multi-user.target, during boot I still see something that looks like a graphical screen display for a while before it drops back to a text mode to display the login prompt.
So, following the instructions, I tried to rebuild the initial ramdisk image. The nvidia documentation does not say how to do that, so I Googled and found https://wiki.centos.org/TipsAndTricks/CreateNewInitrd , which unfortunately gives instructions only for CentOS 5 and CentOS 6, but not CentOS 7. I'm afraid to do the wrong thing, so I'm stuck.
Any suggestions would be appreciated.

Thanks.

-Ben




The information in this e-mail is intended only for the ...{{dropped:11}}
#
On 01/11/2016 03:52 PM, Wittner, Ben, Ph.D. wrote:

            
I have not tried it personally, but these instructions seem correct:

http://www.dedoimedo.com/computers/centos-7-nvidia.html

Basically, edit the grub2 cmdline to include the extra option:

  rdblacklist=nouveau

hth,

~tom

==
Red Hat
#
Tom,

Bingo!

I followed the instructions in the link below, which allowed me to install the nvidia driver, which fixed the original problem with rgl.snapshot.

Thanks very much for all your help.

I guess I'll file a bug in the CentOS Bug Tracker so that the nouveau driver might get fixed. I'll also post to R-help so someone with the same problem who only searches R-help and not this SIG will see the solution.

-Ben

-----Original Message-----
From: Tom Callaway [mailto:tcallawa at redhat.com] 
Sent: Monday, January 11, 2016 4:10 PM
To: Wittner, Ben, Ph.D.; r-sig-fedora at r-project.org
Cc: Duncan Murdoch
Subject: Re: [R-sig-Fedora] rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7

I have not tried it personally, but these instructions seem correct:

http://www.dedoimedo.com/computers/centos-7-nvidia.html

Basically, edit the grub2 cmdline to include the extra option:

  rdblacklist=nouveau

hth,

~tom

==
Red Hat


The information in this e-mail is intended only for the ...{{dropped:11}}
#
On 01/11/2016 05:13 PM, Wittner, Ben, Ph.D. wrote:
Awesome. If you have the cycles, I'm sure the CentOS people would
appreciate it if you ran through the nouveau troubleshooting first:

http://nouveau.freedesktop.org/wiki/Bugs/

You might consider also filing a bug with the Nouveau upstream, as the
CentOS people may not be experts with that driver, but the upstream
certainly will be. Keep in mind that they may want you to test the
latest version of the driver first.

Glad we got it working for you though. :)

~tom

==
Red Hat
#
Tom,

I thought about filing a bug report with Nouveau, but it seems that working directly with Nouveau is well beyond my capabilities.

I have no idea how to do most of the stuff Nouveau says to do in their troubleshooting page. And for the small minority of things that I think I might be able to figure out, each one would take me hours of reading and experimentation and begging for help. I'm not an OS guy.

And also, I don't think I can afford to be frequently installing and uninstalling drivers because I need my machine to be stable for my real work.

Nouveau's bug reporting page says "If you are using packages from your distribution and are unable/unwilling to test the latest versions of all the pieces of nouveau, send the bug reports to your distribution and not directly to us." So I thought I should submit the bug report to CentOS.

I'm hoping that it will be relatively easy for someone at CentOS to reproduce the bug and then take it from there, probably working with Nouveau.

-Ben

-----Original Message-----
From: Tom Callaway [mailto:tcallawa at redhat.com]
Awesome. If you have the cycles, I'm sure the CentOS people would appreciate it if you ran through the nouveau troubleshooting first:

http://nouveau.freedesktop.org/wiki/Bugs/

You might consider also filing a bug with the Nouveau upstream, as the CentOS people may not be experts with that driver, but the upstream certainly will be. Keep in mind that they may want you to test the latest version of the driver first.




The information in this e-mail is intended only for the ...{{dropped:11}}
1 day later
#
Ugh.

Below I declared victory, but today I learned that the NVIDIA driver has a problem the nouveau driver did not have. Namely, when using the NVIDIA driver, if I plot a lot of stuff in the RGL window and then using the mouse expand the RGL window, R usually crashes.

One work-around seems to be to
1) close all RGL windows, if there are any
2) call rgl.clear() to create an RGL window
3) re-size that window using your mouse
4) do your plotting

-----Original Message-----
From: R-SIG-Fedora [mailto:r-sig-fedora-bounces at r-project.org] On Behalf Of Wittner, Ben, Ph.D.
Sent: Monday, January 11, 2016 5:14 PM
To: Tom Callaway; r-sig-fedora at r-project.org
Cc: Duncan Murdoch
Subject: Re: [R-sig-Fedora] rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7

Tom,

Bingo!

I followed the instructions in the link below, which allowed me to install the nvidia driver, which fixed the original problem with rgl.snapshot.

Thanks very much for all your help.

I guess I'll file a bug in the CentOS Bug Tracker so that the nouveau driver might get fixed. I'll also post to R-help so someone with the same problem who only searches R-help and not this SIG will see the solution.

-Ben

-----Original Message-----
From: Tom Callaway [mailto:tcallawa at redhat.com] 
Sent: Monday, January 11, 2016 4:10 PM
To: Wittner, Ben, Ph.D.; r-sig-fedora at r-project.org
Cc: Duncan Murdoch
Subject: Re: [R-sig-Fedora] rgl.snapshot only captures a small portion what's visible in the RGL device window on CentOS 7

I have not tried it personally, but these instructions seem correct:

http://www.dedoimedo.com/computers/centos-7-nvidia.html

Basically, edit the grub2 cmdline to include the extra option:

  rdblacklist=nouveau

hth,

~tom

==
Red Hat


The information in this e-mail is intended only for the ...{{dropped:19}}