OpenGL GLUT on VirtualBox Ubuntu 11.10 segmentation error

DISCLAIMER: I see that some suggestions on the same issue have arisen, however, that (similar) mail has been moved to SuperUsers and seems to have been deleted. Nevertheless, I would like to post my question here, because I think that this software / programming is enough not to post messages on superusers (the line is sometimes vague between what is software and what is the hardware problem).

I am running a very simple OpenGL program in Code :: Blocks on VirtualBox with Ubuntu 11.10 installed on an SSD. Whenever I create and run a program, I get the following errors:

  • OpenGL Warning: XGetVisualInfo returned 0 visual effects for 0x232dbe0
  • OpenGL Warning: try again with 0x802, typing 0 visual images
  • Segmentation error

From what I have compiled so far, it is related to VirtualBox. I need to install

  • LIBGL_ALWAYS_INDIRECT = 1

In other words, enabling indirect rendering through X.org, rather than directly communicating with the hardware. This problem is probably not related to the fact that I have an ATI card, since I have a laptop with an ATI card that works flawlessly with the same program.

However, I dare not say that the fact that my GPU is ATI does not play any role whatsoever. I'm also not sure that the drivers are installed correctly (under "System Information β†’ Graphics β†’ Graphics Driver: Chromium.)

Any help on HOW to set LIBGL_ALWAYS_INDIRECT = 1 would be greatly appreciated. I just do not have enough information about where to put this command or where / how to execute it in the terminal.

Sources:

EDIT: in terminal type:

export LIBGL_ALWAYS_INDIRECT = 1 

To verify that direct rendering is turned off:

 glxinfo | grep direct 

However, the problem persists. I still mention OpenGL warnings and a segmentation error.

+4
source share
2 answers

If you look at the /etc/environment file, you will see a couple of variables open there - this will give you an idea of ​​how to set this environment variable throughout the system. You can also try placing it in ~/.profile or ~/.bash_profile depending on your needs.

The real question in my mind: have you installed guest add-ons for Ubuntu? You do not need to install any ATI drivers in the guest server, since VirtualBox will not expose the virtual machine to physical hardware. You can configure the guest to support 3D acceleration in the settings of the virtual machine (first, make sure that you turn off the virtual machine) in the "Screen" section. You will probably want to increase the allocated virtual memory - 64 MB or 128 MB should be depending on your needs.

+4
source

I ran into the same issue that ran the OpenLL Bullet Physics demos on Ubuntu 12.04 inside VirtualBox. Instead of using indirect rendering, I was able to solve the problem by changing the code for creating the overflow window in my source, as described here: https://groups.google.com/forum/?fromgroups=#!topic/comp.graphics.api .opengl / Oecgo2Fc9Zc .

This entailed replacing the original.

 ... glutCreateWindow(title); ... 

from

 ... if (!glutGet(GLUT_DISPLAY_MODE_POSSIBLE)) { exit(1); } glutCreateWindow(title); ... 

as described in the link. I don’t understand why this should fix the segfault problem; glutGet seems to have some side effects without getting status values. It could be a quirk of selling a silencer.

+9
source

Source: https://habr.com/ru/post/1402109/


All Articles