I'm having a problem with my configuration of LD_LIBRARY_PATH environment variable for UBUNTU.
My system configuration is the following: UBUNTU 17.10 CUDA 8.0 (required by Tensorflow) NVIDIA DRIVER 387.26
My current LD_LIBRARY_PATH is set as follow in the .profile file: export LD_LIBRARY_PATH="/usr/lib/nvidia-387:/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
I had to include also /usr/lib/nvidia-387 because of this
I also had to set my primary graphic controller to "INTEL" because I wanted my GPU free from any other graphic process (basically I run sudo prime-select intel)
However when /usr/lib/nvidia-387 is set I can't login to my profile anymore: after password input I just get a black screen for several seconds, and I eventually return to the login screen.
I also attach my current XORG conf (copied and pasted from other similar topic).
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
Any idea how to solve? It's important that I keep the LD_LIBRARY_PATH as is.
Thank you for your help.
Best Answer
I didn't solve the problem. But I have a workaround for you.
1. edit
/etc/default/grub
Modify
GRUB_CMDLINE_LINUX_DEFAULT
toThis step is to prevent blank screen after logging in.
2. move nvidia library directories to
/etc/ld.so.conf.d/nvidia.conf
The content of
nvidia.conf
isThese directories depends on driver version on your computer.
3. create
/etc/init.d/nvidia
To disable and enable nvidia runtime libraries.
4. execute
update-rc.d nvidia defaults
You should find
SXXnvidia
in/etc/rc5.d/
andKXXnvidia
in/etc/rc6.d/
,/etc/rc0.d/
.Try to execute
/etc/init.d/nvidia stop
andnvidia-smi
, you should see error messages of libraries not found.Try to execute
/etc/init.d/nvidia start
, thennvidia-smi
is fine again.If everything is OK, you can reboot now. You are expected to login to desktop.
5. If anything goes wrong
The most possible problem is
nvidia
script not executed. If it happens, you can press Ctrl+Alt+F1 to tty mode, execute/etc/init.d/nvidia stop; reboot
. Then you can go back to unity desktop to debug.6. known side-effect
When use intel as prime GPU,
unity-control-center
(system settings) will be failed to start.Note: my system spec