knazarov / homebrew-qemu-virgl

A homebrew tap for qemu with support for 3d accelerated guests
420 stars 68 forks source link

Qemu says opengl is disabled #31

Open colourfullyy opened 3 years ago

colourfullyy commented 3 years ago

Hi, When I try to run these commands: qemu-system-aarch64 \ -machine virt,accel=hvf,highmem=off \ -cpu cortex-a72 -smp 2 -m 4G \ -device intel-hda -device hda-output \ -device virtio-gpu-pci \ -device virtio-keyboard-pci \ -device virtio-net-pci,netdev=net \ -device virtio-mouse-pci \ -display cocoa,gl=es \ -netdev user,id=net,ipv6=off \ -drive "if=pflash,format=raw,file=./edk2-aarch64-code.fd,readonly=on" \ -drive "if=pflash,format=raw,file=./edk2-arm-vars.fd,discard=on" \ -drive "if=virtio,format=raw,file=./hdd.raw,discard=on" \ -cdrom focal-desktop-arm64.iso \ -boot d

and

qemu-system-aarch64 \ -machine virt,accel=hvf,highmem=off \ -cpu cortex-a72 -smp 2 -m 4G \ -device intel-hda -device hda-output \ -device virtio-gpu-pci \ -device virtio-keyboard-pci \ -device virtio-net-pci,netdev=net \ -device virtio-mouse-pci \ -display cocoa,gl=es \ -netdev user,id=net,ipv6=off \ -drive "if=pflash,format=raw,file=./edk2-aarch64-code.fd,readonly=on" \ -drive "if=pflash,format=raw,file=./edk2-arm-vars.fd,discard=on" \ -drive "if=virtio,format=raw,file=./hdd.raw,discard=on"

nothing happens except this output: qemu-system-aarch64: OpenGL support is disabled

I've never seen anything like this before, I would appreciate any help. (I'm running an m1 macbookair with macos big sur 11.4)

knazarov commented 3 years ago

I’d say you probably have stock qemu installed. Try executing qemu-system-aarch64 --version

When installing both stock version and the version from this repo, only one symlink “wins”

knazarov commented 3 years ago

If the symlink points to the proper place, try running brew reinstall --verbose -s qemu-virgl 2>&1 | tee build.log and attach the resulting build.log here. I'll check that the configuration phase properly detects libANGLE.

ghost commented 2 years ago

Having this same issue on an Intel Mac. The output when trying to install Fedora or any other OS is:

qemu-system-x86_64: OpenGL support is disabled

Any new insight since the last post on this issue?

BuggusMageevers commented 4 months ago

Same issue on Apple M1 and I just installed QEMU with brew on 06/30/2024. I tried running brew reinstall --verbose -s qemu-virgl 2>&1 | tee build.log anyway as I do not see that you received a log previously, but I got the following error Error: No available formula with the name "qemu-virgl".. Is there a different version you like a build.log on?

My current machine with personal information removed:

% system_profiler SPSoftwareDataType SPHardwareDataType
Software:

    System Software Overview:

      System Version: macOS 14.5 (23F79)
      Kernel Version: Darwin 23.5.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled

Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro17,1
      Chip: Apple M1
      Total Number of Cores: 8 (4 performance and 4 efficiency)
      Memory: 16 GB
      System Firmware Version: 10151.121.1
      OS Loader Version: 10151.121.1

I have a zsh script for creating and running my QEMU VM. I have been playing around with the settings so that setup and start options for qemu-system-aarch64 do not exactly match. The poor graphical performance is the same either way. The relevant functions are:

QEMU_CreateVMNixOS() {
    echo "Retreiving environment variables..."
    dd if=/dev/zero conv=sync bs=1m count=64 of=ovmf_vars.fd
    echo "Creating NixOS image..."
    qemu-img create -f qcow2 nixos.qcow2 20G
    echo "Setting up NixOS..."
    qemu-system-aarch64 \
      -cpu host -M virt,accel=hvf,highmem=on \
      -m 4096 \
      -drive file=/opt/homebrew/share/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on \
      -drive file=ovmf_vars.fd,if=pflash,format=raw \
      -drive if=none,file=nixos.qcow2,format=qcow2,id=hd0 \
      -device virtio-blk-device,drive=hd0,serial="dummyserial" \
      -device virtio-gpu-pci \      
      -device virtio-keyboard
      -device virtio-mouse \
      -device virtio-net-device,netdev=net0 \
      -serial telnet::4444,server,nowait \
      -netdev user,id=net0 \
      -cdrom /**/qemu/nixos-minimal-24.05.2150.89c49874fb15-aarch64-linux.iso \
      -full-screen
}
QEMU_StartNixOS() {
    echo "Start up NixOS..."
    qemu-system-aarch64 \
      -cpu host -M virt,accel=hvf,highmem=off \
      -m 2048 \
      -drive file=/opt/homebrew/share/qemu/edk2-aarch64-code.fd,if=pflash,format=raw,readonly=on \
      -drive file=ovmf_vars.fd,if=pflash,format=raw \
      -drive if=none,file=nixos.qcow2,format=qcow2,id=hd0 \
      -device virtio-blk-device,drive=hd0,serial="dummyserial" \
      -device virtio-gpu \
      -device intel-hda \
      -device virtio-keyboard \
      -device virtio-mouse \
      -device virtio-net-pci,netdev=net0 \
      -serial telnet::4444,server,nowait \
      -netdev user,id=net0 \
      -full-screen
}

Error qemu-system-aarch64: OpenGL support is disabled occurs when display cocoa,gl=on is added to the above commands. The only available gpu options that allow the VM to start are virtio-gpu and virtio-gpu-pci. virtio-gpu-gl is not available and produces error qemu-system-aarch64: -device virtio-gpu-gl: 'virtio-gpu-gl' (alias 'virtio-gpu-gl-pci') is not a valid device model name. Of the two available GPU options, neither seem to producing any hardware acceleration as there are many graphical glitches. Performance is slow (understandably as it is a VM), but quite a bit slower than expected. Current testing has been with Hyprland.

Running NixOS without a desktop environment, and using terminal interface only works fine and is rather snappy. I can get Tmux going with no lag and no graphical issues.

I also tried UTM, but performance was worse.