# Intel performance issue



## zspider (Jun 5, 2013)

Hello,

Tonight I updated all my ports, I immediately noticed that my graphical performance has degraded. I have this emulator called PCSXR and I've been using it for weeks without any issue, but tonight, after updating the ports(which included some key graphics libraries like libGL,libGLU, etc) the frame rates are so bad I can't use it anymore.

Does anyone else notice this in any other applications?

My graphics hardware is Intel HD4000 - Ivy Bridge.


----------



## PageDir (Jun 5, 2013)

I have this problem too. My card is an Intel GMA 4500, KMS and NEW_XORG is enabled. *B*efore upgrade (several X related ports), the score of glxgears without vsync is about 1500 FPS, now only 500 FPS. Supertuxkart and Assaultcube are very slow and not playable. There must be something wrong with those ports.


----------



## PageDir (Jun 5, 2013)

*W*ell, I realized before this upgrade, the "OpenGL renderer string" is not "Mesa X11", (see `glxinfo | grep OpenGL`). *T*his string is provided by graphics/libGL's intern*a*l driver, "Mesa X11" means dri/i915/i965 is not enabled, so the poor performance can be explained.

And when I look into the source code, I found MesaLib-7.6.1.tar.bz2 is still there, together with MesaLib-8.0.5.tar.bz2, so I removed the previous one, and ran `portmaster -B libGL`, then restarted X, and the problem is gone.

*A*lso, the binary size has been changed:
before:

```
wc /usr/local/lib/libGL.so.1                                               
   20620  157024 3993999 /usr/local/lib/libGL.so.1
```
after:

```
wc /usr/local/lib/libGL.so.1                                               
     578   12230  659057 /usr/local/lib/libGL.so.1
```

*N*ow the "OpenGL renderer string" is correct:

```
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Mobile IntelÂ® GM45 Express Chipset 
OpenGL version string: 2.1 Mesa 8.0.5
OpenGL shading language version string: 1.20
```

I hope this could be helpful.


----------



## zspider (Jun 5, 2013)

PageDir said:
			
		

> *W*ell, I realized before this upgrade, the "OpenGL renderer string" is not "Mesa X11", (see `glxinfo | grep OpenGL`). *T*his string is provided by graphics/libGL's intern*a*l driver, "Mesa X11" means dri/i915/i965 is not enabled, so the poor performance can be explained.
> 
> And when I look into the source code, I found MesaLib-7.6.1.tar.bz2 is still there, together with MesaLib-8.0.5.tar.bz2, so I removed the previous one, and ran `portmaster -B libGL`, then restarted X, and the problem is gone.
> 
> ...



You know this morning I was also looking at the `glxinfo` output and not seeing a single line about an Intel graphics and that perplexed me. I'm currently testing your solution. I  will report back if it works.


----------



## zspider (Jun 6, 2013)

Sadly, it did not work. My `glxinfo` still shows the Mesa output.


```
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: Brian Paul
server glx version string: 1.4 Mesa 8.0.5
client glx vendor string: Brian Paul
client glx version string: 1.4 Mesa 8.0.5
GLX version: 1.4
OpenGL vendor string: Brian Paul
OpenGL renderer string: Mesa X11
OpenGL version string: 2.1 Mesa 8.0.5
OpenGL shading language version string: 1.20
```

Looking in my Xorg logs, I also see


```
Failed to change owner or group for file /dev/dri/card0!
```

I don't know what else to do, maybe I just need to tear down the ports and reinstall.


----------



## wblock@ (Jun 6, 2013)

Before doing something drastic, ask on the freebsd-x11 mailing list.  Maybe it's a known issue.


----------



## zspider (Jun 6, 2013)

Well I just rebuilt /usr/ports/graphics/libGL after uninstalling libGL, removing the Mesa tarball from the distfiles and removing the whole libGL folder and extracting a fresh copy. Now it's back to the way it should be. `glxinfo` once again shows my Intel graphics and my framerates on the emulator are back their normal levels.

Not sure which one of those made the difference, but thanks for the help anyways.


----------



## wblock@ (Jun 6, 2013)

The old distfile is almost certainly not the problem.  Nothing cleans out old distfiles until you run, say, `# portmaster -t -y --clean-distfiles`.  Ports use distfiles by name, including the version, so the right one is used.

Rebuilding graphics/libGL is probably what made the difference.


----------



## zspider (Jun 6, 2013)

wblock@ said:
			
		

> The old distfile is almost certainly not the problem.  Nothing cleans out old distfiles until you run, say, `# portmaster -t -y --clean-distfiles`.  Ports use distfiles by name, including the version, so the right one is used.
> 
> Rebuilding graphics/libGL is probably what made the difference.



I think so too, I didn't consider the distfile to the likely culprit because the incorrect tarball would not of matched the hash value. I noticed the issue with the OpenGL performance drop happened after the update but before I restarted X, so I started purging and rebuilding the associated libraries one by one, I got lucky and happened to rebuild libGL first, which upon testing yielded the results I wanted (normal FPS and proper `glxinfo` output) and saved me the trouble of rebuilding any of the others.


----------

