• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 11 12 13 14 15 ... 116 Next »

How to make Dolphin works within Docker
View New Posts | View Today's Posts

Thread Closed 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
How to make Dolphin works within Docker
01-26-2017, 09:50 AM
#1
Diom
Unregistered
 
Lightbulb 
Hello,

I'm new to Dolphin, and I'm running GNU/Linux Debian 8 Jessie on my computer, and this post will be also my presentation, so Hello ! Angel

This computer is my only workstation, but also my home server, so it runs 24/7. Because of that, I do not have any discrete GPU on this computer because of the electricity build each year Big Grin

And as it's not only a workstation, but also a personnal server I don't want to move from stable to testing or sid. And dolphin-emu is only available for testing and sid branch of Debian.


I looked for backporting dolphin-emu to stable, but it implies a lot of dependencies, it didn't worth backporting all of these compared to maintain a sid server (wich I did before, it's not as nightmare as we could think, really not).

So this "tutorial" will be only for Intel i915 but it seems easy to adapt to NVidia GPU (didn't found any documentation for ATI sorry; but I didn't looked for Tongue ).


Assuming these, I gave a chance to Docker which I use a lot on this machine, but only for "daemon-type" services, it will be the first time I use Docker for GUI application, and **SPOILER ALERT** it works  Big Grin .
So you can consider a lot of work to improve or debug it, because I'm writing this post just after I got Mario Sunshine works well, so it's beta state  Wink


-----------------------------------------------------

First of all, this is the configuration :

Code:
Hardware is :
Intel i5 6500
8GB DDR4 RAM
System and Dolphin running on a Samsung 850 EVO SSD


Kernel, mesa libs, and Intel i915 module come from backports to support HD530 (Skylake) correctly.
Code:
Software is :
4.7.0-0.bpo.1-amd64 #1 SMP Debian 4.7.8-1~bpo8+1 (2016-10-19) x86_64 GNU/Linux
libgl1-mesa-dri:
 Installé : 12.0.4-2~bpo8+1
 Candidat : 12.0.4-2~bpo8+1
Table de version :
    13.0.3-1 0
       -10 http://ftp.fr.debian.org/debian/ testing/main amd64 Packages
       -10 http://ftp.fr.debian.org/debian/ unstable/main amd64 Packages
*** 12.0.4-2~bpo8+1 0
       100 http://httpredir.debian.org/debian/ jessie-backports/main amd64 Packages
       100 /var/lib/dpkg/status
    10.3.2-1+deb8u1 0
       990 http://ftp.fr.debian.org/debian/ jessie/main amd64 Packages
libgl1-mesa-glx:
 Installé : 10.3.2-1+deb8u1
 Candidat : 10.3.2-1+deb8u1
Table de version :
    13.0.3-1 0
       -10 http://ftp.fr.debian.org/debian/ testing/main amd64 Packages
       -10 http://ftp.fr.debian.org/debian/ unstable/main amd64 Packages
    12.0.4-2~bpo8+1 0
       100 http://httpredir.debian.org/debian/ jessie-backports/main amd64 Packages
*** 10.3.2-1+deb8u1 0
       990 http://ftp.fr.debian.org/debian/ jessie/main amd64 Packages
       100 /var/lib/dpkg/status
xserver-xorg-video-intel:
 Installé : 2:2.99.917+git20161206-1~bpo8+1
 Candidat : 2:2.99.917+git20161206-1~bpo8+1
Table de version :
    2:2.99.917+git20161206-1 0
       -10 http://ftp.fr.debian.org/debian/ testing/main amd64 Packages
       -10 http://ftp.fr.debian.org/debian/ unstable/main amd64 Packages
*** 2:2.99.917+git20161206-1~bpo8+1 0
       100 http://httpredir.debian.org/debian/ jessie-backports/main amd64 Packages
       100 /var/lib/dpkg/status
    2:2.21.15-2+b2 0
       990 http://ftp.fr.debian.org/debian/ jessie/main amd64 Packages

Docker version is :

Code:
$ docker version
Client:
Version:      1.13.0
API version:  1.25
Go version:   go1.7.3
Git commit:   49bf474
Built:        Tue Jan 17 09:44:08 2017
OS/Arch:      linux/amd64

Server:
Version:      1.13.0
API version:  1.25 (minimum version 1.12)
Go version:   go1.7.3
Git commit:   49bf474
Built:        Tue Jan 17 09:44:08 2017
OS/Arch:      linux/amd64
Experimental: false


-----------------------------------------------------

Now, there is the Dockerfile and the command I use to create it (with explanations of courses, it's worthless without them Tongue )

PS: It's not a tuto to use Docker, there is plenty of them on the web, and well written than "this one" (I really can't call it a tutorial), so Docker explanations will be minimalists.

My Dockerfile (file used by Docker to generate our container) :


Code:
# Run dolphin in a container

# Base docker image
FROM debian:sid
MAINTAINER Diom

# This is irrelevant now I build it with '--network="host"' option
# echo "nameserver 192.168.0.254\nnameserver 80.67.169.12\nnameserver 80.67.169.40" > /etc/resolv.conf \
#     && echo "deb http://ftp.fr.debian.org/debian/ unstable main contrib non-free" > /etc/apt/sources.list \

#Install Dolphin and prerequisites
RUN apt-get update && apt-get install -y \
   hicolor-icon-theme \
   libgl1-mesa-dri \
   libgl1-mesa-glx \
   libpulse0 \
   libv4l-0 \
   fonts-symbola \
   # /Start section/ This has been added because needed in my unigine-heaven benchmark test, this doesn't
   # takes a lot of disk space, but might be not necessary. TODO : try to remove them one by one and test
   libfontconfig1 \
   libxrender1 \
   libxrandr2 \
   libxinerama1 \
   libopenal1 \
   mesa-utils \
   # /End section/
   dolphin-emu \
   dolphin-emu-data \
   && apt-get autoremove \
   && rm -rf /var/lib/apt/lists/* \
   && rm -rf /src/*.deb \
   && mkdir -p "/root/.config/dolphin-emu" \
   && mkdir "/roms"


VOLUME /root/.config/dolphin-emu
VOLUME /roms

# ENTRYPOINT ["/usr/games/dolphin-emu"]
# CMD ["-u /config/"]
CMD ["/usr/games/dolphin-emu"]


So, there is some comments on my Dockerfile, but I'll add some more there :

I build my container from a Debian Sid, so I'm relatively up-to-date with libs and such. I though about using an Arch container, but I prefer to stay close to my host system to have more files shared (libraries) and a smaller RAM footprint (I presume).

The part in comment with /Start section/ /end section/ comes from a container I made in parallel to benchmark Docker virtualisation, I added these packages during my tests with Uningine Heaven benchmark, we will talk about this later.

The two VOLUME lines are there to pick theses folder on my host hard drive (and be persistent when I delete my container).


And finally, the two comments line was my first test, but it seems to have a bug (in dolphin ? docker ? me ?) because all of my config files, BUT NOT my GC memory card ( Huh ) where not saved in /config but in "/ /config" (with white space !!), did'nt understood, but my workaround works (the first VOLUME line).

And the CMD is the "only" command launched by Docker when this container is run.



Now the two command lines, one for building this Dockerfile and an other (much more interesting) for running it.

The only 2 things I can say are --network="host" means the network of my build will be my host network (and not a bridged one), and the second is the . (the dot) that means I didn't push it (yet ?) to any repository Blush  (but I share my work here, it's not that bad no ?).


Code:
docker build --network="host" -t dolphin-dato .


And the second one is my "run" command.
To be simplistic, the run command describe how an instance of my image (made by building the Dockerfile) should be launched and work.


Code:
docker run -it --net host --memory 2gb -e DISPLAY=unix$DISPLAY -v /media/storage0/ROM/dolphinconfigs:/root/.config/dolphin-emu -v /media/storage0/ROM/:/roms -v /dev/shm:/dev/shm -v /etc/machine-id:/etc/machine-id -v /run/user/$(id -u)/pulse:/run/user/$(id -u)/pulse -v /var/lib/dbus:/var/lib/dbus -v ~/.pulse:/root/.pulse --device /dev/input/event22 --device /dev/dri:/dev/dri --name dolphin-run dolphin-dato


Ok... let's start :

  1. docker run -it -> means "I want to do this command and directly interact with dolphin (means I wanna play Big Grin )
  2. --net host -> same as above
  3. --memory 2gb -> means limit the memory to 2GB, not "take them right now" (unlike a classic VM), it's not mandatory but bear in mind I run this on my server, I want to preserve QoS and stability, you could do this to the CPU too, I didn't...
  4. -e DISPLAY=unix$DISPLAY -> this is to use my host display with docker (means graphical application)
  5.  -v /media/storage0/ROM/dolphinconfigs:/root/.config/dolphin-emu -v /media/storage0/ROM/:/roms -> these are the two folder I want to export from my host into my container
  6. -v /dev/shm:/dev/shm -v /etc/machine-id:/etc/machine-id -v /run/user/$(id -u)/pulse:/run/user/$(id -u)/pulse -v /var/lib/dbus:/var/lib/dbus -v ~/.pulse:/root/.pulse -> these parameters are there in order to use the pulse-audio from my user session (implies to select pulse audio in dolphin parameters), it's easier with ALSA but we are in 2017 men Big Grin
  7.  --device /dev/input/event22 -> export my controller (PS4-DualShock 4 plugged by USB, rumble works, analog triggers are not analogs, need to investigate)
  8.  --device /dev/dri:/dev/dri -> really important, this is for sharing the Direct Rendering Infrastructure (graphic hardware acceleration) to the container, works without but only CPU rendering.
  9. --name dolphin-run -> name of the container (will be started with 'docker start dolphin-run' after)
  10. dolphin-dato -> this is the name of the image (built above) I use
The eighth point was tricky to find because I didn't found any documentation on this with Docker (lucky ? yes I think because I found this in less than 15 minutes, at first try)
And I made this post because I found this, before, it was really slow. I found this when testing my benchmark container.



And finally, about performances, I would to test the performance drop with Docker, and, seriously, there is no perceptible drop !!!
I ran Unigine Heaven on my computer, then I made a container approximatively the same I show you for Dolphin, just removed Dolphin parts, and add Unigine Heaven. And results are so close I think it might be other process interfering (services, servers ?) on my computer, I should run some more test, but really, I don't want to spent time on this, I don't think I will have different results.



[Image: mini_240407Capturedcrande20170126000804.png] [Image: mini_257442Capturedcrande20170126000814.png]


In conclusion, Docker is made for high speed virtualization and deployment with high level isolation. I just used it to not break my system (by switching to testing), but for deployment, there is some hardware specific parts (libgl's and controller device, but who really wants to automatically deploy Dolphin containers Huh ) and for isolation, I think I share too much devices to really talk about safe isolation Undecided


Sorry for my English, but I'm French and hope I didn't make too much language errors.
01-26-2017, 09:55 AM
#2
Diom
Unregistered
 
[RESERVED]
01-26-2017, 07:25 PM
#3
MayImilae Offline
Chronically Distracted
**********
Administrators
Posts: 4,598
Threads: 119
Joined: Mar 2011
*waves her magic moderator wand*

Moved to Development Discussion!
[Image: RPvlSEt.png]
AMD Threadripper Pro 5975WX PBO+200 | Asrock WRX80 Creator | NVIDIA GeForce RTX 4090 FE | 64GB DDR4-3600 Octo-Channel | Windows 11 22H2
MacBook Pro 14in | M1 Max (32 GPU Cores) | 64GB LPDDR5 6400 | macOS 12
Find
07-13-2019, 11:06 AM
#4
emuJay
Unregistered
 
(01-26-2017, 09:50 AM)Diom Wrote: Hello,

I'm new to Dolphin, and I'm running GNU/Linux Debian 8 Jessie on my computer, and this post will be also my presentation, so Hello ! Angel

This computer is my only workstation, but also my home server, so it runs 24/7. Because of that, I do not have any discrete GPU on this computer because of the electricity build each year Big Grin

And as it's not only a workstation, but also a personnal server I don't want to move from stable to testing or sid. And dolphin-emu is only available for testing and sid branch of Debian.
Hey Diom, have you tried running Dolphin from a Windows Host? I can get it running on a ubuntu container but it crashes whenever I start a game.
The error message isn't helpful either:

21:37:043 /build/dolphin-emu-KMFgN1/dolphin-emu-5.0+r1~23~ubuntu16.04.1/Source/Core/Core/ConfigManager.cpp:887 W[BOOT]: GC bootrom file will not be loaded for Wii mode.

21:37:044 /build/dolphin-emu-KMFgN1/dolphin-emu-5.0+r1~23~ubuntu16.04.1/Source/Core/Core/Core.cpp:978 W[COMMON]: Want determinism <- false
21:37:225 /build/dolphin-emu-KMFgN1/dolphin-emu-5.0+r1~23~ubuntu16.04.1/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp:680 N[Wiimote]: WiimoteReal::Shutdown
31:36:865 /build/dolphin-emu-KMFgN1/dolphin-emu-5.0+r1~23~ubuntu16.04.1/Source/Core/Core/ConfigManager.cpp:86 N[BOOT]: Saving settings to /home/tester/.config/dolphin-emu/Dolphin.ini
31:36:127 /build/dolphin-emu-KMFgN1/dolphin-emu-5.0+r1~23~ubuntu16.04.1/Source/Core/Core/HW/WiimoteReal/WiimoteReal.cpp:680 N[Wiimote]: WiimoteReal::Shutdown
Any suggestions would be appreciated! I'm using a pulseaudio client to pipe my sound back to my host
07-13-2019, 01:11 PM
#5
Shonumi Offline
Linux User/Tester
**********
Administrators
Posts: 6,505
Threads: 55
Joined: Dec 2011
Please try not to necropost. This thread is over 2 years old, and Diom's account is so old and inactive that it's been automatically deactivated. If you're having trouble with Dolphin, it's recommended to make a new thread about it rather than resurrect a fairly forgotten thread such as this. New threads help boost the visibility of your own problem, and people tend to respond more often to them.
Website Find
« Next Oldest | Next Newest »
Thread Closed 


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode