Mir

Mir does not work in vmware virtual machine due to drm open failure

Bug #1157196 reported by Prasanna Kumar
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Mir
Fix Released
Medium
Alexandros Frantzis

Bug Description

Installed Ubuntu 12.10 in VMWare virtual machine. Installed all the required dependencies (as mentioned in the HACKING.md) and compiled Mir code. Followed step 1 to step 7 in section "Running Mir" of the HACKING.md file. Mir did not run correctly while running the command "(sleep 5; ./mir_demo_client_accelerated) & ./mir ; kill $!". The error says "drm open failed" or some thing similar.

This prevents many users from testing and contributing to Mir code. If Mir runs in VMWare then the number of people contributing (as code or bug or documentation etc) will increase drastically.

Note:
VMWare has open source graphics stack and it is based on KMS / DRM and is available in mainline linux kernel tree.

Changed in mir:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This is a duplicate of bug 1118903 right now, because it's about Mir working at all under VMware.

The issue of VMware-specific acceleration, should we ever want to support it, should be discussed elsewhere.

summary: - Mir does not work in vmware virtaul machine due to drm open failure
+ Mir does not work in vmware virtual machine due to drm open failure
Revision history for this message
Prasanna Kumar (prasannatsmkumar) wrote :

This bug is not concerned about acceleration at all. Mir is not able to open drm device only after that acceleration and other stuffs will come into picture.

VMWare has OpenGL 2.1 compliance and it is open source. In future GLES acceleration can be added theoretically so I guess this bug has nothing to do with bug 1118903.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

If we're not concerned about acceleration then it is certainly bug 1118903.

Though, can you please paste the error message?

Revision history for this message
Prasanna Kumar (prasannatsmkumar) wrote :

Attached screen shot of the error.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for the screenshot. That shows you're just having permission problems opening the DRM device. That's not a VM-specific problem but happens on all machines.

Please review HACKING.md and particularly look at step 4 in the section "Running Mir", which describes how to avoid this problem.

Changed in mir:
status: Confirmed → Incomplete
Revision history for this message
Prasanna Kumar (prasannatsmkumar) wrote :

VT7 is running X. I logged into X as the same user and still getting this issue. The screenshot attached in comment 4 is taken after following step 4.

I tried again (made sure step 4 is followed) and getting the same issue.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It's only my experience that to avoid the permission problem you need to log in to VT1 _after_ you have logged in to X.

If that does not solve your problem then it's quite feasibly driver-specific behaviour. And that's fine. It just means you might need to run mir as root. Or find the offending /dev/dri/* and chmod it to your needs.

Revision history for this message
Prasanna Kumar (prasannatsmkumar) wrote :

Even as root got the same error. Did chmod 666 /dev/dri/card0 (only /dev/dri/card0 is present) and tried again as normal user and as root. In all the cases same error appears.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sorry, my mistake. You are getting error:
    EPERM (Operation not permitted)
which I confused for:
    EACCES (Permission denied)

They are related but slightly different. EPERM means your process lacks permission to do whatever it's trying to do. Generally that means you need to be root to make a special system call, or that maybe the driver does not share and play as nice as the intel/radeon drivers do. It's got nothing to do with file/devnode permissions because that would be EACCES.

You might have to stop X completely (sudo stop lightdm) _and_ run mir as root for it to work in this case. Or it might mean some deeper problem with VMware graphics that Mir doesn't support yet.

Revision history for this message
Prasanna Kumar (prasannatsmkumar) wrote :

Same issue even after closing X (stop lightdm) and running Mir as root.

Changed in mir:
status: Incomplete → Triaged
Revision history for this message
David Nall (david-nall) wrote :

Prasanna,

I had this problem as well. In gbm_display_helpers.cpp open_drm_device function there is an array of const char *'s called drivers. I added <"vmwgfx", > before the 0 driver. Vmwgfx is vmwares drm driver. If it isn't in this array the function call drmOpen located in libdrm fails throwing the exception found later in the open_drm_device function.

I did this, recompiled and installed and it loaded the server to a blank screen just fine. Resolution was off so I'm going to install vmware-tools to see if that fixes it.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Great hint. Thanks David.

Revision history for this message
Prasanna Kumar (prasannatsmkumar) wrote :

David, Great and Thanks for the info :). Have you sent any patch for this? If not why don't you send?

Revision history for this message
Prasanna Kumar (prasannatsmkumar) wrote :

While compiling latest code I got the following error

**********************************************************************************************************************
In file included from /home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report.cpp:24:0:
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h: In function ‘void __tracepoint_cb_mir_server_msgproc___received_invocation(const void*, int, const char*)’:
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h:30:1: error: ISO C++ forbids braced-groups within expressions [-Werror=edantic]
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h:30:1: error: ‘typeof’ was not declared in this scope
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h:30:1: error: expected ‘;’ before ‘_________p1’
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h:30:1: error: ‘_________p1’ was not declared in this scope
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h:30:1: error: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Werror]
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h: At global scope:
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h:30:1: warning: missing initializer for member ‘tracepoint::padding’ [-Wmissing-field-initializers]
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h: In function ‘void __tracepoint_cb_mir_server_msgproc___completed_invocation(const void*, int, int)’:
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h:41:1: error: ISO C++ forbids braced-groups within expressions [-Werror=edantic]
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h:41:1: error: ‘typeof’ was not declared in this scope
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h:41:1: error: expected ‘;’ before ‘_________p1’
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h:41:1: error: ‘_________p1’ was not declared in this scope
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h:41:1: error: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Werror]
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h: At global scope:
/home/prasanna/Projects/OpenSource/mir/src/server/lttng/message_processor_report_tp.h:41:1: warning: missing initializer for member ‘tracepoint::padding’ [-Wmissing-field-initializers]
cc1plus: all warnings being treated as errors
make[2]: *** [src/server/lttng/CMakeFiles/mirlttng.dir/message_processor_report.cpp.o] Error 1
make[1]: *** [src/server/lttng/CMakeFiles/mirlttng.dir/all] Error 2
make: *** [all] Error 2
**********************************************************************************************************************

Will try with your suggestion once I am able to compile the code.

Revision history for this message
David Nall (david-nall) wrote :

Sorry for the late reply, I didn't realize you had to subscribe to the bug to get email notifications. I've never used launchpad before. Also having said that I haven't put in a patch for this because I don't know how. I'm also not sure if this is the fixall for vmware because when trying to run natively I get an error in creating a surface and can't initialize EGL. When trying to run as a compositor I get nothing but a blank screen after restarting lightdm.

Being as how I built from source it may be a problem with linking to the right libraries. The hacking guide says to modify LD_LIBRARY_PATH to link to modified mesa libraries but I'm not sure where to get these. I tried compiling mesa from source enabling svga, xa, egl and egl-platforms=x11,drm and linking to these libraries with no change.

It looks like other members have edited their respective drm drivers and I hope that isn't necessary for us. I'll try again with precompiled packages and see if it still crashes. If not I'll just have to figure out which libraries I need to link to. If adding vmwgfx to the drivers array will be the fixall I'll request to make a patch for it.

Revision history for this message
kevin gunn (kgunn72) wrote :

this doesn't seem to be a priority for 13.10....however, its interesting.

specifically we should at a minimum update our instructions for "The hacking guide says to modify LD_LIBRARY_PATH to link to modified mesa libraries but I'm not sure where to get these" ....i tend get lost on statements like these as well not being steeped in years of linux.

Revision history for this message
David Nall (david-nall) wrote :

Yeah it took me a while to find them. I was mainly looking for the source because mesa has a svga driver which supports 3D on vmware and I'm not sure if the precompiled libraries come with it. If you google "RAOF mesa git" you find the source code for mesa that includes the support for mir.

I got all of that so I knew I had the right libraries (compiled with mir platform support). What really helped me is when I figured out you could run ldd on executables. At any rate, the clients were still crashing. I was on the #ubuntu-mir channel and RAOF said that vmware is not yet supported because vmware itself does not support dma which is required of mir. I think they said they were going to develop a fallback mode but this has not been implemented yet so I guess we'll just have to wait.

I was hoping to propose some new features but to make a makeshift demo first. I'm trying to get that working in drm now.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The fallback mode will be bug 1118903.

However we're keeping this bug open in case a vmware-specific fix comes along.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fixed by Alexandros' shm work in Mir 0.1.3 and VMware's efforts to support Mir more recently in kernel 3.13.

Changed in mir:
milestone: none → 0.1.3
status: Triaged → Fix Released
assignee: nobody → Alexandros Frantzis (afrantzis)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.