Cuda 9.2 on ubuntu 17.10 problem

On a new system, although I have installed cuda 9.2 on ubuntu 17.10, I am not able to run basic samples.

The compilation runs fine, but the matrixmul says

CUDA error at …/…/common/inc/helper_cuda.h:1147 code=30(cudaErrorUnknown) “cudaGetDeviceCount(&device_count)”

The bin/ and lib64/ are in the path.

Any thought?

broken driver install

No sign of broken installation
https://pastebin.com/GSG8rqhv

what is the output of:

dmesg |grep NVRM

and

lsmod |grep nouv

and

nvidia-smi

?

If you are on a laptop, you may need to figure out how to enable the dGPU, e.g. using nvidia-prime

https://askubuntu.com/questions/661922/how-am-i-supposed-to-use-nvidia-prime

Right. It turns out that nouveau was the bug.

root@orca2:~# lsmod |grep nouv
nouveau              1638400  13
mxm_wmi                16384  1 nouveau
video                  40960  1 nouveau
i2c_algo_bit           16384  1 nouveau
ttm                    94208  1 nouveau
drm_kms_helper        167936  1 nouveau
drm                   356352  15 nouveau,ttm,drm_kms_helper
wmi                    24576  3 wmi_bmof,mxm_wmi,nouveau

Before removing that, nvidia-smi said “NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.”

When I removed it using nomodeset in the kernel options, the nvidia-smi was fine and matrixmul was fine too.

Thanks

Proper install instructions are contained in the linux install guide:

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html