0
votes

I have an ubuntu 18.04 (System76 desktop) that has built in Intel graphics. I tried plugging in an nVidia K40m gpu card for matlab computations, but I am running into numerous problems. The card has a gpu but it is just for computing, not for driving a monitor. I have the matlab parallel toolbox that is designed to work with this type of gpu.

1) When I install the nVidia driver, the machine seems to try to use the K40m card as a display and stops using the Intel graphics. I can't figure out how to stop this without removing the nVidia driver driver.

2) I can't seem to get the right CUDA driver to work with Matlab either.

Any sugestions for how to fix these?

1
I can't test this as I have no external GPU and am still on Ubuntu 16.04. I would however let go of trying to use one GPU for this and one for that, I'd start by trying to use NVIDIA driver for both screen and computation.Simpler debugging. Note that it may be required to turn off secure boot from BIOS before installing the driver. After installing NVIDIA driver try running nvidia-smi on bash terminal to see that all is well. You can post output here if issues come up. Then try running a = gpuArray; on matlab and see if you get errors.Yuval Harpaz
Thanks, but this machine has Intel graphics and the K40m card is compute only. So, I have to use the Intel graphics for display and MATLAB only works with nVidia GPUs.Chris Hansen

1 Answers

1
votes

I did some search and the latest driver version for your gpu is 410. Suppose you want to use CUDA 10, then there's no need to install nvidia driver at first since the 410 driver is already included in CUDA 10. Read the cuda10 Installation Guide for linux creafully.

https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=runfilelocal

Download the runfile version cuda, and be very careful to every step of its command line prompts.

These steps works for me, with a Intel graphics and Nvidia graphics together in my laptop.(and I use Inter one to show). I can't make sure it also works for you since the gpu is not same. Please follow the cuda installation guide for linux at first or something not clear here.

  1. remember the location of cuda10 run file.
  2. make sure disable Nouveau, enter or touch this file: /etc/modprobe.d/blacklist-nouveau.conf

input two lines:

blacklist nouveau 
options nouveau modeset=0 

save and then command line:

sudo update-initramfs -u 
  1. systemctl set-default runlevel3.target to make your computer only command line version after reboot,then reboot, use command line lsmod | grep nouveau,to check whether you disable nouveau, if there's no output, it's right.
  2. sudo sh cuda_10.0.130_410.48_linux.run

(1)EULA Acceptance-------y

(2)CUDA Driver installation------y

(3)openGL-------n

(4)x-server-------n

(5)CUDA Toolkit installation location --------------Enter

(6)CUDA Samples installation and location ---------------Enter

If everything is fine, command line:

systemctl set-default runlevel5.target

Then reboot.

  1. set environment path in ~/.bashrc PATH=/usr/local/cuda-10.0/bin LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64 then source ~/.bashrc

  2. make sure all things are right. cat /proc/driver/nvidia/version

    nvcc -V

    nvidia-smi

  3. test cuda cd your-own-sample-path to/1_Utilities/deviceQuery

    sudo make

    ./deviceQuery