Verifying CUDA-Capable GPU in Ubuntu - cuda

I downloaded and installed CUDA-7.5 and found that instruction that I need to check whether I have a CUDA-Capable GPU.
I did as
lin#lin-VirtualBox:/opt/caffe$ sudo update-pciids
Downloaded daily snapshot dated 2015-09-07 03:15:01
then why I type
lspci | grep -i nvidia
nothing comes out.
lin#lin-VirtualBox:/opt/caffe$ lspci | grep -i nvidia
lin#lin-VirtualBox:/opt/caffe$
I have NVIDIA graphic card GEFORCE GT750M.
What could be wrong?
My OS is Ubuntu14.04.
Thanks

It seems you are running in a VirtualBox VM (virtual machine) instance. With a typical VirtualBox setup, the graphics in the VM is virtualized; there is no physical GPU device present in the VM.
As a result, the GPU does not show up when you run lspci in the VM.
One possible approach to work around this would be to switch to a "baremetal" config; i.e. load Ubuntu directly on your laptop as the primary (or "host") OS, rather than in a VM. The GPU should show up that way.
Another possible approach would be to attempt to use VirtualBox PCI Passthrough to make the GPU "visible" in the VM. Whether or not this would work in a laptop scenario I don't know; there may be side effects of trying to pass through the laptop GPU to a VM; your laptop hypervisor and any other OS's would not have access to the GPU (or the laptop display) in this situation. I think there are a number of other requirements and restrictions with this approach. Your laptop hardware may or may not meet the requirements, and I think it is expected that the host OS uses some specific flavors of linux (kernel); you may have windows as the host OS on your laptop.
In any event, how to configure your machine with VirtualBox and/or PCI Passthrough is not a programming question, and I think is off-topic for SO. You might try askubuntu or another similar forum, for related questions.

Related

Booting a QorIQ PowerPC firmware in Qemu

I have a QorIQ (P2041) processor based IoT device firmware. I have uBoot, Kernel and initrd ramdisk. Whatever I do with qemu-system-ppc I can't get it to work. I suspect that qemu-system-ppc doesn't support QorIQ processors. Is there anyway for me to load and boot this firmware in Qemu or any other emulator?
U-Boot has configuration file qemu-ppce500_defconfig. You should be able to run the U-Boot built with this configuration using command
qemu-system-ppc -nographic -bios u-boot -M ppce500
The CPU can be specified via the -cpu parameter as e500mc.
To run your kernel it will need drivers for the hardware provided by the emulated machine like the E1000 network card and the NS16550 console.
Use the fdt command of U-Boot to get an overview of the available devices in the emulated machine.
Firmware binaries are generally very closely tied to the hardware they're built to run on -- they make assumptions about what hardware is available, what addresses in memory it can be found at, and so on. You need to use a firmware blob that corresponds to the hardware you're asking QEMU to emulate. Since QEMU doesn't emulate whatever your random IoT device is, you need to use a u-boot which matches the hardware QEMU actually has (as for example suggested in Xypron's answer).
Once you have booting firmware, you will likely still find you have exactly the same problem with the kernel -- it is built to run on one bit of hardware, and you're trying to run it on something different, and this simply won't work.

Which CPU is being emulated by Qemu by default?

I'm currently running a VM without selecting a CPU type. How can I know which one is being emulated? Is there a way to ask this to the Qemu monitor?
Host machine is Windows 10 and guest is Plan 9. Not using KVM.

CUDA samples cause machine to crash

I was planning on starting to use CUDA on a machine with Kubuntu 12.04 LTS and a Quadro card. I installed CUDA 5.5 using the .deb from here, and the installation seems to have gone fine. Then I built the CUDA samples, again everything went fine.
When I run the samples in sequence, however, some of them botch my display, and others simply crash my computer.
What causes the crash? How can I fix it?
I'll mention that my NVidia card is the only display adapter the machine has, but that shouldn't make CUDA crash and burn.
The problem was due to the X server using the FOSS nouveau drivers. These are known to conflict with NVidia's way of accessing the card. When I restarted X (actually, I restarted the machine), the samples did run and work properly.
Not all the samples are runnable if you just installed CUDA on a clean ubuntu system. Some of them require additional libraries, and some of them require particular CC versions.
You could read the CUDA sample document of those crashed samples for more information.
http://docs.nvidia.com/cuda/cuda-samples/index.html

Can you Program/Test CUDA in a Virtual Machine?

I ask this as a programming and environment question. Can you test/program CUDA within a virtual machine accessing the physical GPU card?
I am buying a new (really nice system) to, in part, experiment with basic CUDA programming. The processor will be an Intel i7-4770 which supports VT-d (direct IO pass-through) OR a i7-4770K which does not. Will the VT-d support allow access to the GPU card from the VMs? (I have looked at Intel, motherboard mfg. sites, and docs on VMs but did not see an answer to this question.)
I plan to run Linux as my base operating system on the new development box with virtual machines (probably via QEMU/KVM) to test the software in other environments such as Windows and Mac OS. I other words, I would do the major development on the Linux box and then need to test on a virtual machine running on the same box.
But, will the VM OSs be able to access the GPU card for testing/development?
[First asked July 2013]
It depends on what NVIDIA card you're using. See for example: (this is in regards to Xen)
http://wiki.xen.org/wiki/XenVGAPassthroughTestedAdapters#Nvidia_display_adapters
The short answer is you probably would need to rely on modifying a consumer card as they link above as 'Australian crazy guy'.

Anyone can introduce some primers about qemu-kvm and kvm?

I am a fresh man in kvm,qemu-kvm and kvm are both very complicated now.
Anyone can introduce some primers about qemu-kvm and kvm?
thanks very much!
KVM stands for kernel based virtual machine. it enables you to create as many number of virtual machine as you like. These machine can be of two types LVM based or Non-LVM based.
Those machine which are LVM based you can take live backup for them. for non-lvm based VM you cannot take live backup i.e. they will be paused when you take backup for them. please refer KVM home page KVM Home Page.
QEMU is a generic and open source machine emulator and virtualizer.When used as a machine emulator, QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (e.g. your own PC). By using dynamic translation, it achieves very good performance. When used as a virtualizer, QEMU achieves near native performances by executing the guest code directly on the host CPU. QEMU supports virtualization when executing under the Xen hypervisor or using the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86, server and embedded PowerPC, and S390 guests.
For managing the KVM VM's you need to install Libvirt which is the virtualization library. It provides you the tools for starting, suspending, resuming, cloning, restarting, listing of virtual machine. Please refer Libvirt home page for more reference.
If you are working on some backup or recovery process then I suggest you to go through this excellent perl script as well it will give a fair idea of how the backup and snapshot is being taken for KVM VM's.
KVM based virtual machines are not complicated once you go through the theory of them and start implementing them. I believe once you start working on them you will find fun in managing them.
Putting in a nutshell
QEMU : An emulator which translates the instruction of guest operating system to host operating system. As you can guess that translation has a certain cost, you will not see Guest machine working as fast as host machine.
For more info see the QEMU wiki
KVM (Kernal Virtual Machine): A module in Kernel which support Virtual Machine (host operating system) in hardware. By support I mean that if your guest architecture is same as host architecture, then certainly there is no need to translate the instructions as they can directly be executed by host. For this modern hardware are equipped with special registers and storage location which is leveraged by KVM. Also KVM is a module, some driver is needed to use the KVM, which is qemu also.
For more info see the KVM section in the same wiki.
QEMU-KVM : As I above mentioned, KVM is a module only, qemu is needed (or other) to use KVM. When KVM is used with QEMU, control transfers from QEMU to KVM and vice-versa over the execution.
Talking about KVM is talking about virtualization technology or about kernel modules (kvm.ko, kvm-intel.ko or kvm-amd-ko). Sometimes KVM is mentioned as a virtual machine, this is not correct, because KVM does not provide virtualized hardware.
Source