11

I've connected a graphics adapter to my Ubuntu 14.10 server. I'm using VirtualBox and need to enable access to the GPU under VM. The GPU is working on the server but not on the VM.

$ sudo lshw -C video
  *-display               
       description: VGA compatible controller
       product: NVIDIA Corporation
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:84:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:151 memory:fa000000-faffffff memory:f0000000-f7ffffff memory:f8000000-f9ffffff ioport:f000(size=128) memory:fb000000-fb07ffff

I've installed the Guest Additions according the following explanation: How do I install Guest Additions in a VirtualBox VM?

In addition, I went over this installation guide

And also this one

When I tried cat /proc/driver/nvidia/version according to the previous link, nothing happened. nvidia folder doesn't exist

Here is the error I get when I try to access the GPU from the VM:

modprobe: ERROR: could not insert 'nvidia_340': No such device
Error using gpuArray
No supported GPU device was found on this computer. To learn more about supported GPU devices, see <a href="matlab:web('http://www.mathworks.com/gpudevice','-browser')">www.mathworks.com/gpudevice</a>.
Error in main (line 2)

parallel:gpu:device:NoCUDADevice

Please advise.

11

VirtualBox will not expose the host GPU directly to a guest unless you use PCI passthrough. You could try that, but it is still experimental and might not work.

It would be much easier to use the Linux host directly instead of trying to do this in a VM. If you really need a container for some reason, then try LXC (see the answer to Using GPU from a docker container).

Not the answer you're looking for? Browse other questions tagged or ask your own question.