FedoraForum.org - Fedora Support Forums and Community
Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2009
    Posts
    2,120

    How to test 3D acceleration in virt-manager.

    Make sure you have audit >= 2.6.2-1, see Bug 1351995. It's in updates-testing at the moment. Install virt-viewer, it works much better than the virt-manager built-in viewer. Download the F24 Cinnamon spin live DVD. In virt-manager, open File > Add Connection... select "QEMU/KVM user session" for the Hypervisor. Back in the virt-manager GUI. right click on "QEMU/KVM user session" and create a new VM. Initially, create a diskless VM by connecting the CDROM device to the F24 Cinnamon iso. Boot into the live image and power it down. Follow the instructions here, shown below for my VM.
    Code:
    $ virt-xml --connect qemu:///session fedora-live --confirm --edit --video clearxml=yes,model=virtio,accel3d=yes
    
    $ virt-xml --connect qemu:///session fedora-live --confirm --edit --graphics clearxml=yes,type=spice,gl=on,listen=none
    Right-click your VM and run it. In a terminal, type "virt-viewer -a fedora-live" or whatever you named your VM. You should not get the software rendering warning when the VM reboots. Also, all the host selinux errors I got earlier are fixed. You know 3D accelleration is working if you see:
    Code:
    $ glxinfo | grep renderer
        GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
        GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
    Extended renderer info (GLX_MESA_query_renderer):
    OpenGL renderer string: Gallium 0.4 on virgl
    Last edited by dd_wizard; 3rd July 2016 at 05:26 AM.

  2. #2
    Join Date
    Sep 2009
    Posts
    2,120

    Re: How to test 3D acceleration in virt-manager.

    Here's an update. If you run "ip link", you should see that virt-manager has set up virbr0 for you. When you create the VM, change from user space networking to virbr0. It's much faster. Also, the 3.6 kernels do not work in the VM, so don't try to boot them. Also, selinux must be set to permissive or disabled. Using enforcing won't let the VM start.

    dd_wizard

  3. #3
    Join Date
    Aug 2011
    Location
    ~
    Posts
    1,897

    Re: How to test 3D acceleration in virt-manager.

    This is great. I surely will try it out!
    What OpenGL level is exposed (I guess some Mesa maximum like 4.0-4.3-ish) and what is the performance like (comparable to the host)?
    I hope it will be much more stable and functional than the VirtualBox solution (it crashes nouveau and is unusable for even light gaming).

  4. #4
    Join Date
    Sep 2009
    Posts
    2,120

    Re: How to test 3D acceleration in virt-manager.

    I see around 50 FpS on extreme tux racer with Intel HD4000 graphics. The most useful improvement is Cinnamon desktop itself, it's much smoother. As I said in my second post, there are still some selinux issues, even though I don't see any AVC denial messages.

    dd_wizard

  5. #5
    Join Date
    Jul 2016
    Location
    US
    Posts
    1

    Re: How to test 3D acceleration in virt-manager.

    Thanks for the tips!

  6. #6
    Join Date
    Mar 2011
    Location
    /
    Posts
    5,093

    Re: How to test 3D acceleration in virt-manager.

    Stuck the thread

    Thanks dd_wizard for the nice guide.
    Fedora 27 x86_64 XFCE - Sager | Intel Core i7 - 4810 MQ | NVIDIA GeForce GTX 860M | 16 GB RAM | 480 GB ADATA SSD |
    Fedora 27 x86_64 XFCE - Dell Precision M4800 | Intel Core i7 - 4900 MQ | NVIDIA Quadro K1100M | 16 GB RAM | 750 GB 7200 RPM HDD |


    The Linux Documentation Project | Fedora Documentation

  7. #7
    Join Date
    Jul 2017
    Location
    toronto
    Posts
    7

    Re: How to test 3D acceleration in virt-manager.

    I hope I am not intruding, but I would like to share my virgl script as well as an alternative, if that's okay; it took me so long to finally figure out how to get qemu running nicely that I thought I'd share it and save people the hassel (and potential hairloss).

    This script is for running qemu itself, without virt-manager, as some people with older machines prefer to do, and it's the same result; glxinfo spat out the same stuff. The performance is simply awesome. Youtube uses at least about half the CPU power on both host and vm, it shaved about 1/3 off my bootup time.

    myfedorascript:
    Code:
    /usr/bin/qemu-system-x86_64 \
             -cpu host \
             -smp 1,sockets=1,cores=1,threads=1 \
             -soundhw hda \
             -device AC97 \
             -machine accel=kvm,usb=off,vmport=off \
             -m 1024M \
             -vga virtio \
             -display gtk,gl=on \
             -drive file=/vm/fedora.img,format=raw,if=virtio,aio=threads,cache=writeback \
             -device virtio-serial \
             -netdev user,id=vmnic,hostname=localhost \
             -device virtio-net,netdev=vmnic \
             -show-cursor \
             -usbdevice tablet \
             -nodefconfig \
             -nodefaults \
      $1 \
    To run, change 'fedora.img' to whatever file you intend to run. Adjust '1024M' to whatever memory you would like to use. You may add additional parameters to the script as I did with '-snapshot,' which, in this case, doesn't not change the raw image but creates a new temporary image and then deletes it upon shutdown. Great for messing around and trying new things. I haven't been able to use -snapshot in virt-manager; it seems that they haven't added it in yet:

    Code:
    ./myfedorascript '-snapshot'
    Enjoy!

Similar Threads

  1. Cannot use virt-manager
    By chriscowleysoun in forum Using Fedora
    Replies: 4
    Last Post: 17th June 2012, 09:59 AM
  2. Latest version of virt-manager lost detailed information in storage manager
    By wzzrd in forum Alpha, Beta & Snapshots Discussions (Fedora 11 Only)
    Replies: 0
    Last Post: 8th May 2009, 12:03 PM
  3. virt-manager / KVM
    By Peekaazet in forum Using Fedora
    Replies: 0
    Last Post: 15th April 2008, 03:44 PM
  4. virt-manager
    By Peekaazet in forum Using Fedora
    Replies: 0
    Last Post: 15th April 2008, 03:02 PM
  5. Replies: 10
    Last Post: 15th March 2007, 07:10 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •