Goal
I am trying to use CUDA on my nvidia card for research. I don't really care to use it to manage my display as I plan on only using the computer via bash-shell after I finish setting it up.
Problem
My video card is unclaimed by Ubuntu. Bounce to login loop after signing in.
Background
I'm a linux-savy, power-user, computer science phd student, but I'm stumped trying to get my Nvidia gtx 1070Ti graphics card to work. I've been at this every sunday for over two months now.
I've followed these tutorials:
https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia
https://help.ubuntu.com/community/BinaryDriverHowto
https://kislayabhi.github.io/Installing_CUDA_with_Ubuntu/
https://askubuntu.com/a/760935/13693
https://askubuntu.com/a/937204/13693
http://docs.nvidia.com/cuda/cuda-installation-guide-linux
Installing nvidia-current
or nvidia-387
(default chosen when ubuntu installed) , or the latest nvidia-390
results in a boot loop where I'm bounced back to the login screen after login in.
So I used prime-select intel
and removed the modeset=0 blacklist
to get to a working desktop. So below is a review of my current status:
$ uname -a
Linux datalake2 4.13.0-36-generic #40~16.04.1-Ubuntu SMP Fri Feb 16 23:25:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ lspci | grep VGA
03:00.0 VGA compatible controller: NVIDIA Corporation Device 1b82 (rev a1)
08:00.0 VGA compatible controller: Matrox Electronics Systems Ltd. G200eR2 (rev 01)
$ sudo lshw -C video
*-display UNCLAIMED
description: VGA compatible controller
product: NVIDIA Corporation
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:03:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller cap_list
configuration: latency=0
resources: iomemory:33f0-33ef iomemory:33f0-33ef memory:91000000-91ffffff memory:33fe0000000-33fefffffff memory:33ff0000000-33ff1ffffff ioport:2000(size=128) memory:92080000-920fffff
$ apt list --installed | grep "nvidia"
nvidia-387/unknown,now 387.26-0ubuntu1 amd64 [installed]
nvidia-387-dev/unknown,now 387.26-0ubuntu1 amd64 [installed,automatic]
nvidia-cuda-dev/xenial,now 7.5.18-0ubuntu1 amd64 [installed,automatic]
nvidia-cuda-doc/xenial,xenial,now 7.5.18-0ubuntu1 all [installed,automatic]
nvidia-cuda-gdb/xenial,now 7.5.18-0ubuntu1 amd64 [installed,automatic]
nvidia-cuda-toolkit/xenial,now 7.5.18-0ubuntu1 amd64 [installed]
nvidia-modprobe/unknown,now 387.26-0ubuntu1 amd64 [installed,automatic]
nvidia-opencl-dev/xenial,now 7.5.18-0ubuntu1 amd64 [installed,automatic]
nvidia-opencl-icd-387/unknown,now 387.26-0ubuntu1 amd64 [installed,automatic]
nvidia-prime/xenial,now 0.8.2 amd64 [installed]
nvidia-profiler/xenial,now 7.5.18-0ubuntu1 amd64 [installed,automatic]
nvidia-settings/unknown,now 387.26-0ubuntu1 amd64 [installed,automatic]
nvidia-visual-profiler/xenial,now 7.5.18-0ubuntu1 amd64 [installed,automatic]
$ cat /proc/driver/nvidia/version
cat: /proc/driver/nvidia/version: No such file or directory
Weirdness
My second problem seems to be that ubuntu is unable to recognize the need for drivers for my card, even-though I have enabled restricted propitiatory drivers.
sudo software-properties-gtk
gives me nothing as well.
Here is the workaround:
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
You should be able to get CUDA working with this answer. by Ping Chu Hung If you still have issues with the login loop after that there are some highly rated answers here that should resolve that for you.
Note: Like most things in life, Nvidia drivers can leave a bunch of garbage lying around if you've tried to install several versions or had failed installations and it may be necessary to purge them all and then reinstall the one you've had working in the past to get the desired results.