LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-10-2016, 04:48 AM   #16
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,452

Rep: Reputation: 7711Reputation: 7711Reputation: 7711Reputation: 7711Reputation: 7711Reputation: 7711Reputation: 7711Reputation: 7711Reputation: 7711Reputation: 7711Reputation: 7711

Quote:
Thought I'd try here first for Slackware-specific instructions, before heading over to the virtualization forum. There are Debian and Arch guides floating around on the internet, but, as usual, there's always something in these to trip you up. So slacker suggestions, instructions, tips and whatnot welcome!
So who of you guys is going to add this crucial information as a new article on the Slackware Documentation Project Wiki?
 
1 members found this post helpful.
Old 05-19-2016, 01:22 PM   #17
mtslzr
LQ Newbie
 
Registered: May 2005
Location: Austin, TX
Distribution: Slackware
Posts: 12

Rep: Reputation: Disabled
Do I need to do anything fancy re:mouse and keyboard? FWIW, I have two monitors, and my plan was to either split them, or maybe plug one into both cards, and just switch it's input when gaming under Windows. Can I move the mouse between the two, or do I need to set something up for that?
 
Old 05-19-2016, 01:36 PM   #18
archfan
Member
 
Registered: Mar 2016
Location: /dev/hug
Distribution: Slackware 14.2 x64
Posts: 85

Rep: Reputation: 32
Not necessarily. A USB switch for keyboard and mouse and an additional USB card for passthrough is highly recommended though. I also use an external USB sound card for my VM as sound emulation is sort of terrible.

If you don't want to spend money you can always use Synergy or QEMU USB passthrough for your USB peripheral devices.
 
Old 05-19-2016, 03:38 PM   #19
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Knoppix
Posts: 1,823
Blog Entries: 14

Rep: Reputation: 282Reputation: 282Reputation: 282
Synergy works well. Although I am currently using Arch, I had VGA passthrough working on Slackware 14.1. Agree with the notes previously given. Qemu script and libvirtd each have advantages other than the GUI, but to each his/her own. My notes on setup are on my LQ blog pages, though they're a bit dated now. I'd recommend the vfio-kvm mailing list for help, and make sure you check out the guide on vfio.blogspot.com.
 
Old 06-17-2016, 05:18 PM   #20
kthxbye
LQ Newbie
 
Registered: Jun 2016
Posts: 2

Rep: Reputation: Disabled
Greetings!
I've recently dusted my old GTX550Ti in order to try and prepare a virtual machine (x64 Windows 10) with GPU pass-through but I've hit a few issues on the way.
I've followed the guides in this topic (as well as the linked ones) and I managed to go as far as binding the GTX550Ti to vfio-pci but I cannot manage to have a working VM with qemu.

I'm using an up-to-date Slackware64-current installation: I had to recompile the kernel (I used the default kernel's config file and enabled vfio), blacklisted both snd_hda_intel and the nvidia drivers (later to be loaded with modprobe using /etc/rc.d/rc.local) and bound the graphic card to vfio, both the GPU and the audio portion.
lspci -nnk outputs the following (relevant entries only):
Code:
06:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF116 [GeForce GTX 550 Ti] [10de:1244] (rev a1)                                                                                                                                                                   
        Subsystem: ASUSTeK Computer Inc. GF116 [GeForce GTX 550 Ti] [1043:83be]                                                                                                                                                                                                
        Kernel driver in use: vfio-pci                                                                                                                                                                                                                                         
        Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia                                                                                                                                                                                                                  
06:00.1 Audio device [0403]: NVIDIA Corporation GF116 High Definition Audio Controller [10de:0bee] (rev a1)                                                                                                                                                                    
        Subsystem: ASUSTeK Computer Inc. GF116 High Definition Audio Controller [1043:83be]                                                                                                                                                                                    
        Kernel driver in use: vfio-pci                                                                                                                                                                                                                                         
        Kernel modules: snd_hda_intel
iommu groups are ok, as seen here:
Code:
IOMMU group 0
        00:00.0 Host bridge [0600]: Intel Corporation 4th Gen Core Processor DRAM Controller [8086:0c00] (rev 06)
IOMMU group 1
        00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller [8086:0c01] (rev 06)
        01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM206 [GeForce GTX 950] [10de:1402] (rev a1)
        01:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:0fba] (rev a1)
IOMMU group 2
        00:14.0 USB controller [0c03]: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI [8086:8c31] (rev 05)
IOMMU group 3
        00:16.0 Communication controller [0780]: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 [8086:8c3a] (rev 04)
IOMMU group 4
        00:1a.0 USB controller [0c03]: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 [8086:8c2d] (rev 05)
IOMMU group 5
        00:1b.0 Audio device [0403]: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller [8086:8c20] (rev 05)
IOMMU group 6
        00:1c.0 PCI bridge [0604]: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 [8086:8c10] (rev d5)
IOMMU group 7
        00:1c.2 PCI bridge [0604]: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 [8086:8c14] (rev d5)
IOMMU group 8
        00:1c.3 PCI bridge [0604]: Intel Corporation 82801 PCI Bridge [8086:244e] (rev d5)
        04:00.0 PCI bridge [0604]: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge [1b21:1080] (rev 04)
IOMMU group 9
        00:1c.4 PCI bridge [0604]: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #5 [8086:8c18] (rev d5)
IOMMU group 10
        00:1d.0 USB controller [0c03]: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 [8086:8c26] (rev 05)
IOMMU group 11
        00:1f.0 ISA bridge [0601]: Intel Corporation H87 Express LPC Controller [8086:8c4a] (rev 05)
        00:1f.2 SATA controller [0106]: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] [8086:8c02] (rev 05)
        00:1f.3 SMBus [0c05]: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller [8086:8c22] (rev 05)
IOMMU group 12
        03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c)
IOMMU group 13
        06:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF116 [GeForce GTX 550 Ti] [10de:1244] (rev a1)
        06:00.1 Audio device [0403]: NVIDIA Corporation GF116 High Definition Audio Controller [10de:0bee] (rev a1)
The other graphic card (a GTX 950) works as usual with the nVidia proprietary drivers.
I'm using alien's qemu and vde packages if this can be relevant. I also checked if the GTX550Ti works properly and I verified both a Windows installation (dual boot) and my Slackware system (prior to binding the GTX550Ti to vfio) could use the card without issues and output to the monitor I connected.

Once I reached this point, I started to run into several issues.

- Problem #1: no output on the GTX550Ti
I cannot output anything on the GTX550Ti using qemu (the monitor I hooked up keeps giving the NO SIGNAL warning).
I'm using this script to launch qemu:
Code:
#!/bin/sh

INSTALLFILE=/home/kthxbye/vm/win10-uefi-x64.qcow2
FILESIZE=200G

INSTALLCD=/home/kthxbye/archive/windows/win10/Win10_1511_1_English_x64.iso

DRIVERCD=/home/kthxbye/archive/windows/virtio-win-0.1.118.iso

# PCI address of the passtrough devices
DEVICE1="06:00.0"
DEVICE2="06:00.1"

if [ ! -e $INSTALLFILE ]; then
    qemu-img create -f qcow2 -o preallocation=metadata,compat=1.1,lazy_refcounts=on $INSTALLFILE $FILESIZE
fi

cp /usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd /tmp/my_vars.fd

QEMU_AUDIO_DRV=alsa
qemu-system-x86_64 \
  -enable-kvm \
  -m 8192 \
  -smp cores=4,threads=2 \
  -cpu host,kvm=off \
  -vga none \
  -soundhw hda \
  -boot menu=on \
  -usb \
  -device vfio-pci,host=$DEVICE1,multifunction=on \
  -device vfio-pci,host=$DEVICE2 \
  -drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd \
  -drive if=pflash,format=raw,file=/tmp/my_vars.fd \
  -device virtio-scsi-pci,id=scsi \
  -drive file=$INSTALLCD,id=isocd,format=raw,if=none -device scsi-cd,drive=isocd \
  -drive file=$INSTALLFILE,id=disk,format=qcow2,if=none,cache=writeback -device scsi-hd,drive=disk \
  -drive file=$DRIVERCD,id=virtiocd,if=none,format=raw -device ide-cd,bus=ide.1,drive=virtiocd
- Problem #2: BSOD on the VM if using -vga std
If I start the vm with the -vga std option I can install Windows 10; doing so allowed me to verify that the VM does actually see the GTX550Ti with no issues. Windows proceeded to download the latest updates and the drivers for the nVidia card but at the next reboot it started going into a BSOD loop giving one of the two following errors:
Code:
system_service_exception
or
Code:
system_service_exception nvlddmkm.sys
This happens both if I let Windows download the updates and the drivers by itself or if I install the latest drivers myself.

- Problem #3: freezes and garbled audio.
Prior to installing the drivers, the VM works reasonably well, although it's a bit slow at times and I had better success by using
Code:
  -cdrom $INSTALLCD \
  -hda $INSTALLFILE
instead of
Code:
  -device virtio-scsi-pci,id=scsi \
  -drive file=$INSTALLCD,id=isocd,format=raw,if=none -device scsi-cd,drive=isocd \
  -drive file=$INSTALLFILE,id=disk,format=qcow2,if=none,cache=writeback -device scsi-hd,drive=disk \
  -drive file=$DRIVERCD,id=virtiocd,if=none,format=raw -device ide-cd,bus=ide.1,drive=virtiocd
in the qemu script I use.
It does, however, freeze every time it needs to output sound: this happens both with alsa and pulseaudio. The terminal shows this warning:
Code:
main-loop: WARNING: I/O thread spun for 1000 iterations
On top of that, the sound is also heavily garbled. The sound coming from the host is not affected.

Does anyone have any idea about how to solve any of those issues, or where to look for a possible solution?

If I'll manage to have a working VM with proper pass-through and virtualisation I'll also write a step by step guide taken to solve the aforementioned issues.

Thanks in advance!
Cheers,
~kthxbye
 
Old 06-18-2016, 04:28 PM   #21
kthxbye
LQ Newbie
 
Registered: Jun 2016
Posts: 2

Rep: Reputation: Disabled
A quick update: I managed to get output from the GTX550Ti by NOT using the OVMF BIOS, which solves issue #1.
Issue #2 changed as now I don't have to use -vga std to work on the VM; however, after installing the nVidia drivers the GTX550Ti does not output anything (monitor remains blank for a while before giving the no signal warning).
Issue #3 is unchanged.
I have a new issue as well: if I reboot the guest OS and/or restart the VM, I have no output on the GTX550Ti and I have the following warning on the terminal:
Code:
qemu-system-x86_64: vfio-pci: Cannot read device rom at 0000:06:00.0
Device option ROM contents are probably invalid (check dmesg).
Skip option ROM probe with rombar=0, or load from file with romfile=
It only works the first time the VM is started after a reboot of the host OS. I tried to extract the rom to use with the romfile= option but I've been unsuccessful as of yet, as even on a fresh reboot of the host OS it says the rom is invalid when I try to cat it to a new file.
For reference, I've tried this method:
Code:
# cd /sys/bus/pci/devices/0000:06:00.0/
# echo 1 > rom
# cat rom > /tmp/image.rom
# echo 0 > rom
 
Old 06-18-2016, 04:31 PM   #22
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Brú na Bóinne, IE
Distribution: Slackware, NetBSD
Posts: 1,863

Original Poster
Rep: Reputation: 1334Reputation: 1334Reputation: 1334Reputation: 1334Reputation: 1334Reputation: 1334Reputation: 1334Reputation: 1334Reputation: 1334Reputation: 1334
Quote:
Originally Posted by kthxbye View Post
A quick update: I managed to get output from the GTX550Ti by NOT using the OVMF BIOS, which solves issue #1.
Hi - I'm the OP, and I'm still interested in getting this done, but I still haven't replaced the nvidia card that was giving me trouble so I'm not much use to you I'm afraid.
 
Old 11-22-2016, 12:09 PM   #23
camerabambai
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 204

Rep: Reputation: 26
Some question about vga passtrough
I have two video cards
one is nvidia,on host
another is ati,i want to pass it to qemu/libvirt.
I have one tv/monitor with multiple inputs
my card is connected to vga(nvidia) the ati
is on dv.
I have installed with libvirt(i know is foss,
but has a nice virt-manager to add and remove
stuff..) windows 8.1
And on display i can see the windows
But my dream is to see something like this(pic is fake!
i hope it get reality someday..)

https://s12.postimg.org/t4kgq4yzh/ricevuta_ram5.jpg

the gpu card(real) on a screen emulated(vnc,spice...)
Is possible to do something like this with qemu/vga passtrough?

On some youtube video seems possible,but they don't put a simply howto
only the video..

https://www.youtube.com/watch?v=Qi1LdFkRzIs
 
Old 11-22-2016, 06:25 PM   #24
camerabambai
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 204

Rep: Reputation: 26
I see the qemu config on this video of the same user,
he get a very nice result,can play 3d game in little window
using spice client!

https://www.youtube.com/watch?v=_6K9Sxbb_lU

Lucky user,i don't understand how he can get the 3d of real card
on spicy client.
As i understand this configuration works only with intel host+amd guest gpu.
I have tried a similar configuration running this script
but spicy client connect only to qxl card...whitout 3d

Code:
sudo qemu-system-x86_64 -enable-kvm  \
-smp 2,sockets=1,cores=2,threads=1 \
-M pc \
-m 6192 \
-cpu host \
-rtc base=localtime \
-vga qxl \
-spice port=5902,disable-ticketing \
-device virtio-serial \
-chardev spicevmc,id=vdagent,name=vdagent \
-net nic,model=e1000 -net tap,ifname=tap0,script=no \
-device vfio-pci,host=06:00.0,multifunction=on \
-device vfio-pci,host=06:00.1 \
-drive file=.local/libvirt/images/win81.qcow2,format=qcow2 \
-cdrom 1.iso  \
-soundhw hda \
-boot c
I use vfio instead of stub because i cannot find the "unbind" voice

Code:
find  /sys/bus/pci/devices/0000\:0*|grep -i unbi
Return nothing
 
Old 08-08-2019, 05:44 AM   #25
lopid
Member
 
Registered: Jun 2008
Posts: 155

Rep: Reputation: Disabled
Quote:
Originally Posted by Alien Bob View Post
So who of you guys is going to add this crucial information as a new article on the Slackware Documentation Project Wiki?
I'd be happy to, but since I haven't done passthrough since I wrote that post, I'm afraid it would only be a copy-paste job.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Qemu KVM vga passthrough slow cpu speed Holering Linux - Virtualization and Cloud 4 02-08-2015 04:55 PM
qemu/kvm: permissions for pci-passthrough insectiod Linux - Virtualization and Cloud 1 08-20-2014 02:33 PM
LXer: Set up qemu-kvm-1.0+noroms as spice enabled qemu server vs qemu-kvm-spice on Ubuntu Precise LXer Syndicated Linux News 0 05-26-2012 07:41 AM
USB Passthrough Problem with KVM/QEMU on FC12 wdsnyc Linux - Virtualization and Cloud 1 02-23-2010 09:49 PM
On qemu-kvm, qemu-ifup script not found on Slackware 13 AndrewGaven Linux - Virtualization and Cloud 14 01-29-2010 03:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration