High CPU usage with 3D-acceleration in Linux Mint (Virtual Box)

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Noobfire
Posts: 3
Joined: 5. Aug 2017, 14:03

High CPU usage with 3D-acceleration in Linux Mint (Virtual Box)

Post by Noobfire »

I'm currently trying to get Linux Mint 18.2 to work in Oracle Virtual Box.

What have I done so far:

Installed VBoxAdditions 5.0.40 or 5.1.26 (first one through apt-get, second one through the VirtualBox-Guest-Additions .iso itself). That does not mean that I installed them concurrently, after each try I removed the packages with following method:

Completly removed everything about VirtualBox inbetween with apt-get purge virtualbox* and apt-get purge Virtualbox*. The Synaptic Packetmanager showed a total of 0 installed virtualbox packages after that.

I found several tests that show 3D-Acceleration is enabled:

Code: Select all

$/usr/lib/nux/unity_support_test -p

OpenGL vendor string:   Humper
OpenGL renderer string: Chromium
OpenGL version string:  2.1 Chromium 1.9

Not software rendered:    yes
Not blacklisted:          yes
GLX fbconfig:             yes
GLX texture from pixmap:  yes
GL npot or rect textures: yes
GL vertex program:        yes
GL fragment program:      yes
GL vertex buffer object:  yes
GL framebuffer object:    yes
GL version is 1.4+:       yes

Unity 3D supported:       yes
and:

Code: Select all

$inxi -G | grep Renderer      

GLX Renderer: Chromium GLX Version: 2.1 Chromium 1.9
and:

Code: Select all

$glxinfo | grep OpenGL

OpenGL vendor string: Humper
OpenGL renderer string: Chromium
OpenGL version string: 2.1 Chromium 1.9
OpenGL shading language version string: 4.30 - Build 20.19.15.4531
OpenGL extensions:
A quick benchmark showed following result:

Code: Select all

$glxgears

1242 frames in 5.0 seconds = 248.234 FPS
1280 frames in 5.0 seconds = 255.818 FPS
1209 frames in 5.0 seconds = 241.569 FPS
1107 frames in 5.0 seconds = 221.356 FPS
1243 frames in 5.0 seconds = 248.558 FPS
1167 frames in 5.0 seconds = 233.303 FPS
1233 frames in 5.0 seconds = 246.507 FPS
1140 frames in 5.0 seconds = 227.865 FPS
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 71944 requests (71944 known processed) with 0 events remaining
I have to note that the whole system became extremly sluggish and unusable during that benchmark.

In general everthing seems to "work". The usual things associated with Guest-Additions (copy-and-paste, resizing the windows, etc.) seem to work. Browsing with firefox is extremly smooth, even smoother than browsing with Chrome on my Host machine.

But as soon as 3D-accelerated things have to be drawed (it seems like the cinnamon-menu is 3D-accelerated too), my CPU usage on the host machine rises from 0-10% to 40-80% and in general everything becomes extremly laggy. I'm just talking about TYPING single characters in the search bar on the cinnamon start menu. Whenever I type something in firefox or other entering masks, it's extremly smooth. But as soon as I do that in the menu or use other 3D-accelerated things, it seems like the drawing of the 2D-desktop slows down to 5-10 FPS.

That are my settings in VirtualBox:

Code: Select all

3072 MB RAM
2 processor cores
100% CPU ratio
PAE/NX enabled
VT-x enabled
128 MB (max) VRAM
3D-acceleration enabled
It occurs at both of my computers with following hardware:

Code: Select all

i7-4500U
8 GB DDR3 RAM
Intel HD Graphics
and:

Code: Select all

i5-2400 OC to 4,4 GHz
8 GB DDR3 RAM 
GTX 1060
I dont think my hardware is the problem here..

EDIT:

I tried to not use the 3D-acceleration, namely using software-rendering. On a restart, the message that I am currently using software-renering and therefore the UI can seem sluggish appeared.

But quite the contrary. The menu is smoother (NOT smooth. But I would guess something around 15 FPS) and the benchmark (glxgears) showed something around 650 FPS, so about 3x of that we archieved before. So clearly there is something not working correctly with the hardware acceleration.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: High CPU usage with 3D-acceleration in Linux Mint (Virtual Box)

Post by mpack »

Please provide a VM log file. With the VM fully shut down, right click it in GUI. Select "Show Log" and save "VBox.log" (ONLY) to a zip file. Attach the zip here.

You can only avail yourself of 3D acceleration if your host allows it. My guess is that your host is on the default Microsoft OpenGL 1.1 which ships with Windows and is software rendered - i.e. not accelerated at all. This would be common for Intel motherboard graphics.

The log will tell us for sure.
Noobfire
Posts: 3
Joined: 5. Aug 2017, 14:03

Re: High CPU usage with 3D-acceleration in Linux Mint (Virtual Box)

Post by Noobfire »

Thank you for your fast reply!

Well, as I mentioned, I'm using a GTX 1060 on my main machine. I dont think my computer host system (Windows 10 64-bit) is using software rendering :o But I stand to be corrected on that.

Hopefully you can gather some information in the log-file!
Attachments
VBox.zip
(33.46 KiB) Downloaded 216 times
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: High CPU usage with 3D-acceleration in Linux Mint (Virtual Box)

Post by mpack »

You are confusing me somewhat by talking about two PCs with very different configurations. I thought you were asking about the PC which was using Intel HD graphics, but you've given me the log for the PC with NVidia graphics, which is definitely using accelerated 3D. On this PC I would check with the guest process monitor to find out where the CPU is going. I'm not a Linux user, so I can't tell you anything about this.

For the other PC, it may be slow for entirely different reasons. I can't tell without a log.
Noobfire
Posts: 3
Joined: 5. Aug 2017, 14:03

Re: High CPU usage with 3D-acceleration in Linux Mint (Virtual Box)

Post by Noobfire »

The problem with both PCs is so similar and reproducable that I think it does not really have to do much about hardware configurations. I tested my CPU utilization on the linux guest on my main machine (i5-2400 & GTX 1060) right now.
As expected, as soon as I move the mouse in the start menu, the process "cinnamon" rises to a very high CPU usage. I gave the guest 2 Cores, one of the cores rises to about 60-80% usage, the other one to around 20-30%. As soon as I stop mouse movement, my cpu usage falls down to 2-10% overall.
Post Reply