Ubuntu 18.04 and cuda 9.2

I am have issues with getting cuda 9.2 installed on a Linux container using Ubuntu 18.04. I used the Linux .run file to install cuda 9.2 on my host ubuntu 18.04 and have nvidia-smi working.
Fri Aug 10 12:48:10 2018
±----------------------------------------------------------------------------+
| NVIDIA-SMI 396.26 Driver Version: 396.26 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro K4000 Off | 00000000:02:00.0 Off | N/A |
| 30% 48C P0 28W / 87W | 0MiB / 3018MiB | 0% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
±----------------------------------------------------------------------------+

I enabled GPU following https://stgraber.org/2017/03/21/cuda-in-lxd/
I then installed cuda 9.2 in the container using
$ cuda_9.2.88_396.26_linux.run --silent -toolkit --samples
It complains if I try to install the driver in the Linux container.
I do not remember how I got the nvidia-smi programs install in the container.
I now have nvidia-smi working in the Linux container.

I can not compile the samples due to include paths problems so I can not test the CUDA on that level.
I install pytorch but pytorch does not see the GPU.

I am stuck at this point.

I can not get the samples to compile in the

I got CUDA 9.1 installed on both the host and the container. GREAT, but I am trying to compile “dlib” with GPU support and it requires cuDNN, BUT cuDNN only supports 92. and 9.0, it does not support 9.1.
Ubuntu 18.04 is the new LTS release. Getting a deb for 18.04 should be a high priority!

I finally got 9.2 install in LXD container. The secret is Install the driver from a PPA and the install the toolkit from the run file. I assume you can download the files.

On HOST
first install the PPA
sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt-get update

Then install the driver and libs from the PPA
$ sudo apt-get install nvidia-driver-396 libnvidia-compute-396 libnvidia-common-396 nvidia-utils-396

The install the toolkit
sudo sh cuda_9.2.148_396.37_linux.run --silent --toolkit sudo sh cuda_9.2.148.1_linux.run --silent --accept-eula

Then install cuDNN optional
sudo dpkg -i libcudnn7_7.2.1.38-1+cuda9.2_amd64.deb sudo dpkg -i libcudnn7-dev_7.2.1.38-1+cuda9.2_amd64.deb

on LXC
Then in the LXC install the driver and libs from the PPA
$ sudo apt-get install nvidia-driver-396 libnvidia-compute-396 libnvidia-common-396 nvidia-utils-396

and the toolkit
sudo sh cuda_9.2.148_396.37_linux.run --silent --toolkit sudo sh cuda_9.2.148.1_linux.run --silent --accept-eula

Then install cuDNN optional
sudo dpkg -i libcudnn7_7.2.1.38-1+cuda9.2_amd64.deb sudo dpkg -i libcudnn7-dev_7.2.1.38-1+cuda9.2_amd64.deb