knazarov / homebrew-qemu-virgl

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

display resolution (2880x1800) not show up when start with -device virtio-vga-gl #46

Open lzq420241 opened 3 years ago

lzq420241 commented 3 years ago

here are my macbook info:

Screen Shot 2021-08-17 at 12 05 23 AM Screen Shot 2021-08-17 at 12 06 39 AM

I installed an ubuntu 20.04 guest, when start with -device virtio-vga-gl, the output is gl_version 30 - es profile enabled WARNING: running without ARB/KHR robustness in place may crash GLSL feature level 130

with max resolution 1920x1080

Screen Shot 2021-08-17 at 12 13 16 AM

while start with -device virtio-vga, the output is empty, with max resolution 2880x1800

Screen Shot 2021-08-17 at 12 15 11 AM
DUOLabs333 commented 3 years ago

Are you saying the "Resolution" drop-down menu wouldn't show?

lzq420241 commented 3 years ago

no, the drop-down menu showed up, but the maximum resolution is not the same as my 4K display.

DUOLabs333 commented 3 years ago

Isn't it supposed to be virtio-gpu-gl-pci?

DUOLabs333 commented 3 years ago

Also, did you get your microphone and/or camera to work?

lzq420241 commented 3 years ago

virtio-gpu-gl-pci

when apply this, the system can't be login. image

image

DUOLabs333 commented 3 years ago

Oh, that should not happen. Are there any logs (sorry, I use Arch).

keredson commented 2 years ago

I have this same problem. xrandr output showing modes: image

my startup script:

qemu-system-x86_64 \
         -machine accel=hvf \
         -cpu Nehalem -m 8G \
         -device intel-hda \
-device hda-output \
         -device qemu-xhci \
         -device virtio-gpu-gl-pci \
 -device usb-tablet \
         -device virtio-net-pci,netdev=net \
         -device virtio-mouse-pci \
         -display cocoa,gl=es \
         -netdev user,id=net,ipv6=off \
    -hda ubuntu-20.04.1-desktop-amd64.qcow2 \

and its output:

gl_version 30 - es profile enabled
WARNING: running without ARB/KHR robustness in place may crash
GLSL feature level 130
GLSL feature level 130
keredson commented 2 years ago

full xrandr:

derek@derek-od:~$ xrandr --verbose
Screen 0: minimum 320 x 200, current 1600 x 1200, maximum 8192 x 8192
Virtual-2 connected primary 1600x1200+0+0 (0x45) normal (normal left inverted right x axis y axis) 260mm x 195mm
    Identifier: 0x40
    Timestamp:  33677
    Subpixel:   unknown
    Gamma:      1.0:1.0:1.0
    Brightness: 1.0
    Clones:    
    CRTC:       0
    CRTCs:      0
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter: 
    _MUTTER_PRESENTATION_OUTPUT: 0 
    EDID: 
        00ffffffffffff004914341200000000
        2a180104a51a137806ee91a3544c9926
        0f5054210800e1c0d1c0d100a940b300
        9500818081402520006641001a30001e
        334004c310000018000000f7000a0040
        82002820000000000000000000fd0032
        7d1ea0ff010a202020202020000000fc
        0051454d55204d6f6e69746f720a013d
        02030a00457d6560591f000000100000
        00000000000000000000000000000010
        00000000000000000000000000000000
        00100000000000000000000000000000
        00000010000000000000000000000000
        00000000001000000000000000000000
        00000000000000100000000000000000
        00000000000000000000000000000092
    link-status: Good 
        supported: Good, Bad
    CONNECTOR_ID: 31 
        supported: 31
    non-desktop: 0 
        range: (0, 1)
  1024x768 (0x42) 82.290MHz -HSync -VSync +preferred
        h: width  1024 start 1280 end 1310 total 1382 skew    0 clock  59.54KHz
        v: height  768 start  771 end  774 total  794           clock  74.99Hz
  1920x1080 (0x43) 148.500MHz -HSync -VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.50KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  60.00Hz
  1920x1080 (0x44) 148.500MHz +HSync +VSync
        h: width  1920 start 2448 end 2492 total 2640 skew    0 clock  56.25KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  50.00Hz
  1600x1200 (0x45) 162.000MHz +HSync +VSync *current
        h: width  1600 start 1664 end 1856 total 2160 skew    0 clock  75.00KHz
        v: height 1200 start 1201 end 1204 total 1250           clock  60.00Hz
  1680x1050 (0x46) 146.250MHz -HSync +VSync
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock  65.29KHz
        v: height 1050 start 1053 end 1059 total 1089           clock  59.95Hz
  1400x1050 (0x47) 121.750MHz -HSync +VSync
        h: width  1400 start 1488 end 1632 total 1864 skew    0 clock  65.32KHz
        v: height 1050 start 1053 end 1057 total 1089           clock  59.98Hz
  1280x1024 (0x48) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1440x900 (0x49) 106.500MHz -HSync +VSync
        h: width  1440 start 1520 end 1672 total 1904 skew    0 clock  55.93KHz
        v: height  900 start  903 end  909 total  934           clock  59.89Hz
  1280x960 (0x4a) 108.000MHz +HSync +VSync
        h: width  1280 start 1376 end 1488 total 1800 skew    0 clock  60.00KHz
        v: height  960 start  961 end  964 total 1000           clock  60.00Hz
  1360x768 (0x4b) 85.500MHz +HSync +VSync
        h: width  1360 start 1424 end 1536 total 1792 skew    0 clock  47.71KHz
        v: height  768 start  771 end  777 total  795           clock  60.02Hz
  1280x768 (0x4c) 79.500MHz -HSync +VSync
        h: width  1280 start 1344 end 1472 total 1664 skew    0 clock  47.78KHz
        v: height  768 start  771 end  778 total  798           clock  59.87Hz
  1024x768 (0x4d) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x4e) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  640x480 (0x4f) 25.200MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.50KHz
        v: height  480 start  490 end  492 total  525           clock  60.00Hz
  640x480 (0x50) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
derek@derek-od:~$ 
knazarov commented 2 years ago

For x86, the device should be -device virtio-vga-gl. The recent patch has pulled some refactoring from the master branch of qemu, that changed device names and seemingly introduced a few problems for x86 users.

There are 3 ways to fix your problem:

I would like to help debug this, but at the moment I only have access to M1 mac. After moving to another country, I still don't have my stuff shipped to me :(. I hope it'll be here in a few weeks, but until then I can do very little.

lzq420241 commented 2 years ago

tested with .xprofile way per stack overflow answer, not work.

keredson commented 2 years ago

I tried something similar last friday and it didn't work. Recreated (while changing to virtio-vga-gl):

derek@derek-od:~$ xrandr
Screen 0: minimum 320 x 200, current 1600 x 1200, maximum 8192 x 8192
Virtual-2 connected primary 1600x1200+0+0 (normal left inverted right x axis y axis) 260mm x 195mm
   1024x768      74.99 +  60.00  
   1920x1080     60.00    50.00  
   1600x1200     60.00* 
   1680x1050     59.95  
   1400x1050     59.98  
   1280x1024     60.02  
   1440x900      59.89  
   1280x960      60.00  
   1360x768      60.02  
   1280x768      59.87  
   800x600       60.32  
   640x480       60.00    59.94  
derek@derek-od:~$ cvt 3072 1920 60
# 3072x1920 59.96 Hz (CVT 5.90MA) hsync: 119.26 kHz; pclk: 503.75 MHz
Modeline "3072x1920_60.00"  503.75  3072 3312 3648 4224  1920 1923 1929 1989 -hsync +vsync
derek@derek-od:~$ xrandr --newmode "3072x1920_60.00"  503.75  3072 3312 3648 4224  1920 1923 1929 1989 -hsync +vsync
derek@derek-od:~$ xrandr --addmode Virtual-2 3072x1920_60.00
derek@derek-od:~$ xrandr -s 3072x1920_60.00
Failed to change the screen configuration!
derek@derek-od:~$ 

The VM's screen flashes black on the last command.

keredson commented 2 years ago

Less ambitious custom resolutions don't work either:

derek@derek-od:~$ xrandr --addmode Virtual-2 1600x1400_60.00
derek@derek-od:~$ xrandr -s 1600x1400_60.00
Failed to change the screen configuration!
derek@derek-od:~$ echo $?
1