OC Issues [Kubuntu 17.10] [GTX 1070 Ti] [387.22]

Hello all!

I’m hoping I can get some help here as a last resort after all my efforts and searching. I cannot seem to perform any sort of OC’ing to my 1070 ti running with the 387.22 driver as any attempt I make to update xorg.conf gets overwritten at boot.

I’ve tried to set coolbits via:

$ sudo nvidia-xconfig -a --cool-bits=28 --allow-empty-initial-configuration

Reboot, and it seems my /etc/X11/xorg.conf always gets overwritten after reboot to the following:

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0@0:2:0"
    Option "AccelMethod" "None"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1@0:0:0"
    Option "ConstrainCursor" "off"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "on"
    Option "IgnoreDisplayDevices" "CRT"
EndSection

I’ve also tried fiddling with the gpu-manager as it seems that was overwriting the xorg.conf file.

log_file: /var/log/gpu-manager.log
last_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
new_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
can't access /run/u-d-c-fglrx-was-loaded file
can't access /opt/amdgpu-pro/bin/amdgpu-pro-px
Looking for fglrx modules in /lib/modules/4.13.0-16-generic/updates/dkms
Looking for nvidia modules in /lib/modules/4.13.0-16-generic/updates/dkms
Found nvidia module: nvidia_387.ko
Looking for amdgpu modules in /lib/modules/4.13.0-16-generic/updates/dkms
Is nvidia loaded? yes
Was nvidia unloaded? no
Is nvidia blacklisted? no
Is fglrx loaded? no
Was fglrx unloaded? no
Is fglrx blacklisted? no
Is intel loaded? yes
Is radeon loaded? no
Is radeon blacklisted? no
Is amdgpu loaded? no
Is amdgpu blacklisted? no
Is amdgpu versioned? no
Is amdgpu pro stack? no
Is nouveau loaded? no
Is nouveau blacklisted? yes
Is fglrx kernel module available? no
Is nvidia kernel module available? yes
Is amdgpu kernel module available? no
Vendor/Device Id: 8086:5912
BusID "PCI:0@0:2:0"
Is boot vga? yes
Vendor/Device Id: 10de:1b82
BusID "PCI:1@0:0:0"
Is boot vga? no
Skipping "/dev/dri/card1", driven by "i915"
Skipping "/dev/dri/card0", driven by "nvidia-drm"
Skipping "/dev/dri/card1", driven by "i915"
Skipping "/dev/dri/card0", driven by "nvidia-drm"
Skipping "/dev/dri/card1", driven by "i915"
Skipping "/dev/dri/card0", driven by "nvidia-drm"
Found "/dev/dri/card1", driven by "i915"
output 0:
	card1-HDMI-A-2
Number of connected outputs for /dev/dri/card1: 1
Does it require offloading? yes
last cards number = 2
Has amd? no
Has intel? yes
Has nvidia? yes
How many cards? 2
Has the system changed? No
main_arch_path x86_64-linux-gnu, other_arch_path i386-linux-gnu
Current alternative: /usr/lib/nvidia-387/ld.so.conf
Current core alternative: (null)
Current egl alternative: /usr/lib/x86_64-linux-gnu/mesa-egl/ld.so.conf
Is nvidia enabled? yes
Is nvidia egl enabled? no
Is fglrx enabled? no
Is mesa enabled? no
Is mesa egl enabled? yes
Is pxpress enabled? no
Is prime enabled? no
Is prime egl enabled? no
Is nvidia available? yes
Is nvidia egl available? no
Is fglrx available? no
Is fglrx-core available? no
Is mesa available? yes
Is mesa egl available? yes
Is pxpress available? no
Is prime available? yes
Is prime egl available? no
Intel IGP detected
Intel hybrid system
Nvidia driver version 387.22 detected
/sys/class/dmi/id/product_version="System Version"
/sys/class/dmi/id/product_name="System Product Name"
1st try: bbswitch without quirks
Loading bbswitch with "load_state=-1 unload_state=1" parameters
2nd try: bbswitch with quirks
Loading bbswitch with "load_state=-1 unload_state=1 skip_optimus_dsm=1" parameters
Warning: can't load bbswitch, switching between GPUs won't work
can't access /usr/share/gpu-manager.d/hybrid-performance
intel_matches: 1, nvidia_matches: 1, intel_set: 1, nvidia_set: 1 x_options_matches: 4, accel_method_matches: 1
No need to modify xorg.conf. Path: /etc/X11/xorg.conf
No need to change the current bbswitch status

Any help would greatly be appreciated. Thanks!

gpumanager thinks it’s running on an Optimus laptop. If this is not the case, you can disable it with the kernel parameter
nogpumanager
Then the xorg.conf doesn’t get overwritten anymore.

generix,

I’ve already tried that. I’ve set the following in /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nogpumanager"

When I do this, I get a black screen that prints something like the following and then just hangs:

bbswitch: No suitable _DSM call found.

Note, I have my monitor connected directly to my motherboard and not the GPU. Not sure if that has anything to do with it.

Meh. No wonder it thinks you’re on an Optimus laptop. Run
prime-select intel
then reboot, without the ‘nogpumanager’ parameter.
You should then have a working desktop running on the intel gpu.
For the nvidia gpu you will then have to create another xorg-nvidia.conf somewhere else containing
Option “AllowEmptyInitialConfiguration”
in the device section and start another X server feeding that config explicitly.

Thanks generix!

I’ll give this a shot shortly. For the new xorg.conf config that the nvidia settings X server will use, is that something I can configure it to use by default on boot?

For an extra xserver to start on boot, you’d have to create a systemd unit. Not that complicated.
But this may be easier. Having the intel running perhaps creating a config hint file in /etc/X11/xorg.conf.d like

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

makes the intel xserver load the nvidia gpu without using it, so you can place your coolbits there.

generix,

So I ran “prime-select intel”, rebooted, uninstalled and reinstalled nvidia drivers and rebooted. I updated xorg.conf to include the changes I want, but it’s still getting overwritten.

log_file: /var/log/gpu-manager.log
last_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
new_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
can't access /run/u-d-c-fglrx-was-loaded file
can't access /opt/amdgpu-pro/bin/amdgpu-pro-px
Looking for fglrx modules in /lib/modules/4.13.0-16-generic/updates/dkms
Looking for nvidia modules in /lib/modules/4.13.0-16-generic/updates/dkms
Found nvidia module: nvidia_387.ko
Looking for amdgpu modules in /lib/modules/4.13.0-16-generic/updates/dkms
Is nvidia loaded? yes
Was nvidia unloaded? no
Is nvidia blacklisted? no
Is fglrx loaded? no
Was fglrx unloaded? no
Is fglrx blacklisted? no
Is intel loaded? yes
Is radeon loaded? no
Is radeon blacklisted? no
Is amdgpu loaded? no
Is amdgpu blacklisted? no
Is amdgpu versioned? no
Is amdgpu pro stack? no
Is nouveau loaded? no
Is nouveau blacklisted? yes
Is fglrx kernel module available? no
Is nvidia kernel module available? yes
Is amdgpu kernel module available? no
Vendor/Device Id: 8086:5912
BusID "PCI:0@0:2:0"
Is boot vga? yes
Vendor/Device Id: 10de:1b82
BusID "PCI:1@0:0:0"
Is boot vga? no
Skipping "/dev/dri/card1", driven by "i915"
Skipping "/dev/dri/card0", driven by "nvidia-drm"
Skipping "/dev/dri/card1", driven by "i915"
Skipping "/dev/dri/card0", driven by "nvidia-drm"
Skipping "/dev/dri/card1", driven by "i915"
Skipping "/dev/dri/card0", driven by "nvidia-drm"
Found "/dev/dri/card1", driven by "i915"
output 0:
	card1-HDMI-A-2
Number of connected outputs for /dev/dri/card1: 1
Does it require offloading? yes
last cards number = 2
Has amd? no
Has intel? yes
Has nvidia? yes
How many cards? 2
Has the system changed? No
main_arch_path x86_64-linux-gnu, other_arch_path i386-linux-gnu
Current alternative: /usr/lib/nvidia-387/ld.so.conf
Current core alternative: (null)
Current egl alternative: /usr/lib/nvidia-387/ld.so.conf
Is nvidia enabled? yes
Is nvidia egl enabled? yes
Is fglrx enabled? no
Is mesa enabled? no
Is mesa egl enabled? no
Is pxpress enabled? no
Is prime enabled? no
Is prime egl enabled? no
Is nvidia available? yes
Is nvidia egl available? no
Is fglrx available? no
Is fglrx-core available? no
Is mesa available? yes
Is mesa egl available? yes
Is pxpress available? no
Is prime available? yes
Is prime egl available? no
Intel IGP detected
Intel hybrid system
Nvidia driver version 387.22 detected
/sys/class/dmi/id/product_version="System Version"
/sys/class/dmi/id/product_name="System Product Name"
1st try: bbswitch without quirks
Loading bbswitch with "load_state=-1 unload_state=1" parameters
2nd try: bbswitch with quirks
Loading bbswitch with "load_state=-1 unload_state=1 skip_optimus_dsm=1" parameters
Warning: can't load bbswitch, switching between GPUs won't work
can't access /usr/share/gpu-manager.d/hybrid-performance
intel_matches: 1, nvidia_matches: 1, intel_set: 1, nvidia_set: 1 x_options_matches: 4, accel_method_matches: 1
No need to modify xorg.conf. Path: /etc/X11/xorg.conf
No need to change the current bbswitch status

Actually, it seems that whenever I reinstall nvidia drivers, prime-select goes back to “nvidia”.

Yes, when you install the nvidia-drivers, the system thinks you want to use it. Why did you reinstall them?

generix, that’s because when I tried to use any nvidia-* binary, I’d get errors that certain C compiled object files couldn’t be found. So I created symlinks to the one’s that are needed, but still had issues. Is this expected?

It depends. To use the intel card opengl/egl libraries have to be switched to mesa, so the nividia ones are out of lib path. Take a look at debian’s/ubuntu’s alternatives system (update-alternative). Which specific binaries/libs are problematic?

mhmmm, I’m a bit lost here. I only tried “nvidia-smi” and “nvidia-xconfig”. Both of which gave my problems.

That shouldn’t happen,
ldd /usr/bin/nvidia-smi
linux-vdso.so.1 (0x00007ffc16b3e000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f214a1cc000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f2149fc8000)
libc.so.6 => /lib64/libc.so.6 (0x00007f2149c17000)
/lib64/ld-linux-x86-64.so.2 (0x00007f214a3ec000)
Just normal system libs.

generix,

This is what I get:

❯ sudo prime-select intel 
Info: the current GL alternatives in use are: ['nvidia-387', 'nvidia-387']
Info: the current EGL alternatives in use are: ['nvidia-387', 'nvidia-387']
Info: selecting nvidia-387-prime for the intel profile
update-alternatives: using /usr/lib/nvidia-387-prime/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf (x86_64-linux-gnu_gl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-387-prime/ld.so.conf to provide /etc/ld.so.conf.d/x86_64-linux-gnu_EGL.conf (x86_64-linux-gnu_egl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-387-prime/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_GL.conf (i386-linux-gnu_gl_conf) in manual mode
update-alternatives: using /usr/lib/nvidia-387-prime/alt_ld.so.conf to provide /etc/ld.so.conf.d/i386-linux-gnu_EGL.conf (i386-linux-gnu_egl_conf) in manual mode

reboot,

❯ ldd /usr/bin/nvidia-smi
	linux-vdso.so.1 =>  (0x00007fff3b3fb000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9501d86000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9501b82000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f95017a2000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f950159a000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f9501fa5000)
❯ nvidia-smi 
NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system.
Please also try adding directory that contains libnvidia-ml.so to your system PATH.

I’ve taken a look at the package contents of ubuntu’s nvidia driver package and it is indeed the case that those cannot be used in your use case (video on intel, nvidia for cuda only). In contrary to what update-alternative is saying, not only the opengl/egl libraries get switched out of the path but all nvidia libraries including cuda drivers.
Two possibilities:

  1. Stay with the packages and whenever you want to run anything on the nvidia gpu, prepend something like
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia-XXX with XXX being the driver’s major version number.
    -or-
  2. Purge the nvidia packages and manually install the driver using the .run file with option --no-opengl-files
    WARNING! --no-opengl-files is important, otherwise you would break your mesa install and the intel won’t work. Also try to use dkms so the kernel module will be automatically recompiled on kernel updates.

Thanks generix, I think I’ll try and go with option 1 for now and see what happens. I’m curious how other people handle this. Maybe it’ll be easier if I just connect directly to my GPU.

I think most people using cuda only don’t use a desktop so they simply ignore the integrated gpu or they’re using the manual install.
But I think someone should get in contact with the ubuntu nvidia packaging team and file an enhancement request so they put the libs needed for cuda and management bins into the normal path as your use case is not that far out.

generix, using the LD_LIBRARY_PATH env var still doesn’t seem to work for me.

Hello,
I got the same problems as abezobchuk, and I’ve also tried option 1) and it seems not working for me. Can someone elaborate to the topic ?

dawidgf4,

I still haven’t been able to resolve this. Let me know if you have any luck. I actually attached a 2nd 1070 ti.