How to install nvidia 396.44 driver with K40C in Ubuntu Server 16.04?

The computer is Dell T630 with K40C,I install Ubuntu Server 16.04 from Ubuntu Official Site,but after install OS, there is no graphic interface,So I install

ubuntu-desktop

and reboot,after login into the graphic interface,I install the driver of nvidia-396.44,but then I get stuck at the login loop,So I reinall the Ubuntu,and this time I install the driver first with

sudo apt-get install nvidia-396

and

sudo apt-get install nvidia-396-dev

and I can get

nvidia-smi

But I still don’t have graphic interface,So how to fix it ? how can I have the driver and graphic interface at the same time ? I have tried many ways ,such as remove Xorg,disable nouveau,but none of them works.
nvidia-bug-report.log.gz (123 KB)

That’s a known problem with the ubuntu packages. You can either use ubuntu 16.04 but instead of using the package, download the .run installer from nvidias website, then carefully run it with options
–dkms --no-opengl-files
or use ubuntu 18.04, install the ubuntu driver package and delete the config file
/usr/share/X11/xorg.conf.d/10-nvidia.conf
afterwards. You might have to create a xorg.conf, too.

So I have to download the driver with .run file from nvidia official site rather than from command line ? But I have tried to download a .deb file from https://www.nvidia.com/Download/driverResults.aspx/136950/en-us and still failed.
By the way,what should I install first? the ubuntu-desktop or the nvidia driver ? Considering that I don’t have GUI thus the display is black after install the Ubuntu System.

Yes , you have to use the .run installer for your use case and use the options, the .debs won’t work.
You should first set up Ubuntu so you’ll have a desktop, upgrade HWE ([url]https://wiki.ubuntu.com/Kernel/LTSEnablementStack[/url]) and then install the nvidia driver and cuda-toolkit.

I install the 396.37 driver and CUDA-9.2,I can run the CUDA Sample and run

nvidia-smi

but if I run

nvidia-settings

there is an erros:

ERROR: Unable to load info from any available system

and if I run

sudo prime-select nvidia

it appears these:

Info: the current GL alternatives in use are: ['mese',None]
Info: the current EGL alternatives in use are: ['mesa-egl',None]
Error: the installed packages do not support PRIME
Error: nvidia mode can't be enabled

and I noticed that you mentioned

delete the config file /usr/share/X11/xorg.conf.d/10-nvidia.conf and create a xorg.conf

Could you explain more clearly?

What you’re seeing is the expected outcome with your hardware.

  • The K40c doesn’t have outputs.
  • Your monitor is connected to the integrated video on the mainboard.
  • Since it’s a Dell server model, this is probably a Matrox G200
  • The Matrox driver doesn’t support video redirection from the K40c.
  • The X server is running on the Matrox, so there’s no Nvidia DDX/GLX that nvidia-settings uses.
  • If you want output redirection aka PRIME, you would need an intel gpu.
    To let me confirm my assumptions, pease run nvidia-bug-report.sh as root and attach the resulting .gz file to your post. Hovering the mouse over an existing post will reveal a paperclip icon.

OK , I have attached the file to this post, By the way, I find that I can do deep learning training with K40C ,the process shown in nvidia-smi indicate that the K40C is in used, Is it means that the computer can use GPU with failing to run nvidia-setting ?

Checked the logs, it’s like I said, your graphics is on Matrox.
The k40 is configured and working for cuda only now. Nvidia-settings is a tool for graphics settings only, unrelated to cuda.

If you want nvidia graphics, this would require running a second Xserver in k40 video memory, then grab the screen with x11vnc and display it using vnc. Requires extensive config.
Maybe this would work using a modified bumblebee setup, too, don’t know.
Or simply put in a second nvidia graphics card, hook up the monitor to that and disable the matrox and use the driver package from the distro.

Ok, thanks for your help.