View Issue Details

IDProjectCategoryView StatusLast Update
0000763channel: elrepo/el7primuspublic2017-08-08 13:44
Reportervychytraly Assigned Totoracat  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Summary0000763: New primus update probably disables GL support
DescriptionHello friends, I was using primus package from elrepo and it was working really great, some softwares had occasional glitches (not sure if caused by them or primus) but it was nothing unbearable. Last update made these small glitches disappear, which was great, but today going through some settings in one graphics software I noticed that it is using Intel GPU instead of Nvidia. I was not sure of the cause so I turned it off and started it manually via terminal with optirun command, but I got the same result. Then I tried running glxspheres64 with optirun command and it was using Intel GPU. I am not sure but I think that last update somehow disabled GL support for bumblebee (optirun) and the small glitches disappeared because it was using Intel GPU all the time. I think that support for other functionality remained ok, since I was running some CUDA demos with optirun command which seemed working fine (and they did not work without optirun command).

I tried installing old primus package from akemi ( https://elrepo.org/people/akemi/testing/el7/primus/ ) and now glxshperes64 (when run with optirun command) and also the graphics softwares are using NVidia again.

I am not sure if all this works as I described and new primus package is really the cause of this issues but it just seems to me this way and I wanted to ask you if you think this could be the problem.

Thank you very much and have a nice day :)
TagsNo tags attached.
Reported upstream

Activities

vychytraly

2017-07-26 17:25

reporter   ~0005341

I wanted to test it also with previous version of primus but I cant find it in repository anymore

vychytraly

2017-07-26 17:46

reporter   ~0005342

Or maybe is it all working properly, primus is using Nvidia GPU as it should, just the softwares (glxspheres64...) are somehow not able to recognize that they are actually using Nvidia GPU?

pperry

2017-07-27 00:24

administrator   ~0005346

Acknowledged.

I did make a couple other small changes to the package, so it is not inconceivable that we could have broken something.

Could you double check your findings, and if necessary we could build a test package reverting some of the changes. A full list of changes is available here to view:

https://github.com/elrepo/packages/commit/064a7e2c20b20cee9f52e6c1df47dbbcc6930566#diff-738a9830e025c2886f497b16747588e5

vychytraly

2017-07-27 14:07

reporter   ~0005348

I will try to test it as much as my skills will allow and report my findings. Testing packages like glxinfo, clinfo, glxspheres64, cuda demos come to my mind, if you had any more recommendations how can I test it please let me know :)

vychytraly

2017-07-29 13:22

reporter   ~0005355

Today I made few tests with last primus package and got these results:

clinfo command shows 2 available devices:
intel i7 cpu and intel hd graphics

optirun clinfo command shows 3 available devices:
nvidia gpu, intel i7 cpu and intel hd graphics

(I think this output was expected)



glxinfo command shows me these lines:
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2)

optirun glxinfo command shows me these lines:
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2)

(Here I expected that in case using optirun glxinfo command, OpenGL vendor and renderer string would be NVidia - I think in previous primus versions it worked that way)



glxgears -info command shows these lines:
GL_RENDERER = Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2)
GL_VERSION = 3.0 Mesa 11.2.2
GL_VENDOR = Intel Open Source Technology Center

optirun glxgears -info shows these lines:
GL_RENDERER = Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2)
GL_VERSION = 3.0 Mesa 11.2.2
GL_VENDOR = Intel Open Source Technology Center

(Here again when running optirun glxgears command I expected NVidia in GL_RENDERER and GL_VENDOR lines)



glxspheres64 command shows this:
Context is Direct
OpenGL Renderer: Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2)

optirun glxspheres64 command shows this:
Context is Direct
OpenGL Renderer: Mesa DRI Intel(R) HD Graphics 530 (Skylake GT2)

(Here again when running optirun glxspheres64 command I expected NVidia in OpenGL Renderer line)



nvidia-smi shows this:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.59 Driver Version: 384.59 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 960M Off | 00000000:02:00.0 Off | N/A |
| N/A 42C P0 N/A / N/A | 0MiB / 4044MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+

optirun nvidia-smi shows this:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.59 Driver Version: 384.59 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 960M Off | 00000000:02:00.0 Off | N/A |
| N/A 42C P0 N/A / N/A | 5MiB / 4044MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 27319 G Xorg 4MiB |
+-----------------------------------------------------------------------------+

(We can see here that when running optirun nvidia-smi, NVidia is running (or at least trying to run) Xorg)



deviceQuery utility from CUDA samples shows this:
 CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL

optirun deviceQuery shows this:
 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce GTX 960M"
  CUDA Driver Version / Runtime Version 9.0 / 8.0
  CUDA Capability Major/Minor version number: 5.0
  Total amount of global memory: 4044 MBytes (4240965632 bytes)
  ( 5) Multiprocessors, (128) CUDA Cores/MP: 640 CUDA Cores
  GPU Max Clock rate: 1176 MHz (1.18 GHz)
  Memory Clock rate: 2505 Mhz
  Memory Bus Width: 128-bit
  L2 Cache Size: 2097152 bytes
  Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
  Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers
  Total amount of constant memory: 65536 bytes
  Total amount of shared memory per block: 49152 bytes
  Total number of registers available per block: 65536
  Warp size: 32
  Maximum number of threads per multiprocessor: 2048
  Maximum number of threads per block: 1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
  Maximum memory pitch: 2147483647 bytes
  Texture alignment: 512 bytes
  Concurrent copy and kernel execution: Yes with 1 copy engine(s)
  Run time limit on kernels: Yes
  Integrated GPU sharing Host Memory: No
  Support host page-locked memory mapping: Yes
  Alignment requirement for Surfaces: Yes
  Device has ECC support: Disabled
  Device supports Unified Addressing (UVA): Yes
  Device PCI Domain ID / Bus ID / location ID: 0 / 2 / 0
  Compute Mode:
     < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 9.0, CUDA Runtime Version = 8.0, NumDevs = 1, Device0 = GeForce GTX 960M
Result = PASS

(I think this again works as expected)



Looking at these results I think that primus runs great when trying to use OpenCL or CUDA - it uses NVidia GPU as expected, but when trying to run OpenGL software it does not make OpenGL run on NVidia but on Intel (before the last update it was running also on NVidia). I dont know any other tests how to try this, if I should run anything else please let me know :)

vychytraly

2017-07-29 13:37

reporter   ~0005356

I can confirm that when running optirun with virtualgl (not primus bridge) glxgears64 runs on NVidia:

$ optirun -b virtualgl glxspheres64
Context is Direct
OpenGL Renderer: GeForce GTX 960M/PCIe/SSE2

Same with glxgears

$ optirun -b virtualgl glxgears -info
GL_RENDERER = GeForce GTX 960M/PCIe/SSE2
GL_VERSION = 4.5.0 NVIDIA 384.59
GL_VENDOR = NVIDIA Corporation

Same with glxinfo

$ optirun -b virtualgl glxinfo
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 960M/PCIe/SSE2

I think that this also shows that primus in current state does not work with OpenGL as it should :/

vychytraly

2017-07-29 13:41

reporter   ~0005357

But when looking at github changes I am not really sure what could be the problem :/ maybe we should somehow point primus to use nvidia GL libraries instead of Intel ones?

pperry

2017-07-29 13:49

administrator   ~0005358

Can you confirm the original primus package that Akemi built worked?

If so, I will rebuild the package reverting the changes I made except to filter the libGL provides, and that should establish if it's something we broke in the latest package.

vychytraly

2017-07-29 13:57

reporter   ~0005359

Ok I installed Akemi's primus package and got these results:

optirun glxspheres64
Context is Direct
OpenGL Renderer: GeForce GTX 960M/PCIe/SSE2

optirun glxgears -info
GL_RENDERER = GeForce GTX 960M/PCIe/SSE2
GL_VERSION = 4.5.0 NVIDIA 384.59
GL_VENDOR = NVIDIA Corporation

optirun glxinfo
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 960M/PCIe/SSE2

(Everything seems fine)

pperry

2017-07-29 14:16

administrator   ~0005360

OK, I'll revert the changes I made and lets see if we can figure out what caused it to break. Will post back here once done.

vychytraly

2017-07-29 14:17

reporter   ~0005361

Ok thank you very much, looking forward to test it :)

pperry

2017-07-29 14:37

administrator   ~0005362

I've reverted the changes other than filtering the Provides for libGL.so, and pushed primus-20150328-3.el7.elrepo.x86_64.rpm to the testing repo. It should show up here shortly:

http://elrepo.org/linux/testing/el7/x86_64/RPMS/

Hopefully that should fix things.

vychytraly

2017-07-30 09:31

reporter   ~0005363

Thank you very much Phil, now it seems working with OpenGL applications as before :) but while dealing with this new primus package and testing it I probably discovered a bug regarding OpenCL running on NVidia - OpenCL is discovered by applications just fine, but they cant use it - I keep getting errors like this:

1 devices found supporting OpenCL:

Error 221 in clCreateContext call !!!

or:

[opencl_init] could not create context for device 0: 221
[opencl_init] FINALLY: opencl is NOT AVAILABLE on this system.
[opencl_init] initial status of opencl enabled flag is OFF.

I also tested the previous primus package and I get the same results, so it seems that it is not an issue of primus. Im not sure if its bug of the new kmod-nvidia driver branch or it was present before. Is some additional configuration needed for OpenCL to work correctly with kmod-nvidia? I have installed ocl-icd, opencl-filesystem and opencl-header on my machine for a long time and with Intel CPU/GPU OpenCL seems working fine, its just NVidia which seems having problems.

vychytraly

2017-07-30 09:52

reporter   ~0005364

could it be caused by the fact that current nvidia driver uses CUDA 9 for OpenCL (this is output from clinfo): Platform Version OpenCL 1.2 CUDA 9.0.130 but NVidia only provides CUDA 8 for download?

pperry

2017-07-30 10:55

administrator   ~0005365

OK, pleased we seen to have resolved the initial primus issue.

I've no idea on the OpenCL issue as I don't use it or CUDA I'm afraid. Can I suggest you try downgrading the nvidia drivers to 375.66 to see if they work, and then open a new bug if required for that issue.

vychytraly

2017-07-30 11:26

reporter   ~0005366

Thank you again very much Phil. And yes you are right, after downgrading kmod-nvidia driver OpenCL works fine, so its probably bug of current version, I will open a new thread.

vychytraly

2017-08-07 14:12

reporter   ~0005379

I think that we can mark this issue as resolved :)

vychytraly

2017-08-07 14:16

reporter   ~0005381

(New Primus seems working as before :) )

pperry

2017-08-08 13:44

administrator   ~0005382

Thanks

Issue History

Date Modified Username Field Change
2017-07-26 17:23 vychytraly New Issue
2017-07-26 17:23 vychytraly Status new => assigned
2017-07-26 17:23 vychytraly Assigned To => toracat
2017-07-26 17:25 vychytraly Note Added: 0005341
2017-07-26 17:46 vychytraly Note Added: 0005342
2017-07-27 00:24 pperry Note Added: 0005346
2017-07-27 14:07 vychytraly Note Added: 0005348
2017-07-29 13:22 vychytraly Note Added: 0005355
2017-07-29 13:37 vychytraly Note Added: 0005356
2017-07-29 13:41 vychytraly Note Added: 0005357
2017-07-29 13:49 pperry Note Added: 0005358
2017-07-29 13:57 vychytraly Note Added: 0005359
2017-07-29 14:16 pperry Note Added: 0005360
2017-07-29 14:17 vychytraly Note Added: 0005361
2017-07-29 14:37 pperry Note Added: 0005362
2017-07-30 09:31 vychytraly Note Added: 0005363
2017-07-30 09:52 vychytraly Note Added: 0005364
2017-07-30 10:55 pperry Note Added: 0005365
2017-07-30 11:26 vychytraly Note Added: 0005366
2017-08-07 14:13 vychytraly Note Added: 0005379
2017-08-07 14:16 vychytraly Note Added: 0005381
2017-08-08 13:44 pperry Note Added: 0005382
2017-08-08 13:44 pperry Status assigned => closed
2017-08-08 13:44 pperry Resolution open => fixed