Le blog de Jean David TECHER, un Réunionnais à Saint-Priest/Lyon

Aller au contenu | Aller au menu | Aller à la recherche


< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 >

mercredi 12 avril 2017

[Xen 4.8.0] Windows 10 Pro 64 Bits: VGA Passthrough (HD 7970) + Xen PV Drivers 8.2.0

Video (Youtube)

Below is a video for Xen 4.8.0.


Xen 4.8.0: Virtual Machine = Win 10 Pro 64, GPU = HD 7970 ( Vga passthrough), RAM = 8GB, Xen PV Drivers 8.2.0

Configuration file

First I was convinced that I had to patch Xen so VGA Passthrough process can work. Reading Xen documentation I discovered that it was not the case. You just need to override msitranslate parameter to 0 for the GPU Card.

#################################
# Mandatory Configuration Items #
#################################
name="Windows"

########################
# Selecting Guest Type #
########################
builder='hvm'

########################
# Device-Model Options #
########################
device_model_version="qemu-xen-traditional"

# 2 Parameters listed below are optional when device_model_version is set to qemu-xen-traditional
# I keep them here as simple reminder :D
#device_model_override="/usr/lib/xen/bin/qemu-dm"
#firmware_override="/usr/lib/xen/boot/hvmloader"

##################
# CPU Allocation #
##################
vcpus = '4'

#####################
# Memory Allocation #
#####################
memory='8192'

##################################################
# Fully-virtualised (HVM) Guest Specific Options #
##################################################
boot="cd"
hap=1

###################################
# Processor and Platform Features #
###################################
#bios="rombios" # This parameter is optional and can only be set to rombios when using qemu-xen-traditional
pae=1
acpi=1
apic=1
hap=1
hpet=1

###############################
# Guest Virtual Time Controls #
###############################
localtime=1
############
#  Devices #
############
# Disks
#======
disk = [
        'phy:/dev/xenvgssd/mercury-xenvgssd-Window-10-64Bits-disk-1,xvda,w',            # Disk 1
        'file:/opt/Xen/CD_DVD/Win10_1607_SingleLang_French_x64.iso,xvdc:cdrom,r',       # CD-ROM
        ]

# Network Interface
#==================
# Notice model e1000 is supposed to be the fastest device
vif=[ 'mac=00:26:2d:23:c5:ff,bridge=xenbr0,model=e1000' ]

# PCI to Passthrough
#====================
# Notice: For Xen 4.8 I had 
# - to add rdm_policy=relaxed option for USB controllers x2 
# - to override msitranslate to 0 for my graphic card as workaround for VGA Passthrough.
#   parameter pci_msitranslate governs all PCI. Its value can be overridden by using 'msitranslate=0' to a local PCI
#   That the reason why I used it for my HD 7970 AMD Card
#   OR use pci_msitranslate=0 as global value instead of the local parameter for GPU

pci  = [ 
'01:00.0,msitranslate=0',       # VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Tahiti XT [Radeon HD 7970]
'01:00.1,msitranslate=0',       # Audio device: Advanced Micro Devices [AMD] nee ATI Tahiti XT HDMI Audio [Radeon HD 7970 Series]
'00:1d.0,rdm_policy=relaxed',   # USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05) # USB CONTROLLER - PC FRONT
'00:1a.0,rdm_policy=relaxed'    # USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05) # USB CONTROLLER - PC BACK 
]

e820_host=1

# Vga Passthrough
#=================
# Quoted from Xen documentation:
# Note that some graphics adapters (AMD/ATI cards, for example) do not necessarily require 
# gfx_passthru option, so you can use the normal Xen PCI passthrough to assign the graphics card 
# as a secondary graphics card to the VM. The QEMU-emulated graphics card remains the primary 
# graphics card, and VNC output is available from the QEMU-emulated primary adapter.
gfx_passthru=0 # Disables graphics device PCI passthrough.

#################
# Event Actions #
#################
on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'

###################################
# Miscellaneous Emulated Hardware #
###################################
usb=1
usbdevice = 'tablet' # Required to get the pointer mouse synchronized while using VNC
soundhw = "all"
serial='pty'
audio="on"

################################
# Emulated VGA Graphics Device #
################################
sdl=0
vnc=1
vnclisten="0.0.0.0"
vncconsole=1
vncpasswd=''

################################################
# Support for Paravirtualisation of HVM Guests #
################################################
#xen_extended_power_mgmt=1
xen_platform_pci=1
viridian = 1
monitor=1

[Xen 4.3.4] Window 10 Home - VGA Pass Through (GTX 680 harcoded to GRID K2)

Hello Xen! Yes I got back to Xen 2 weeks ago. There is no interesting game to port on Linux for the moment. So I took decision to get back to Xen. Below is a video of Windows 10 Home runing as a virtual machine with full access to my GPU (GRID K2). This card reminds me pretty nice great moments for 2011-2013


Xen 4.3.4: Windows 10 Home as virtual machine with full access to GPU (GTX 680, hardcoded to GRID K2)

dimanche 19 mars 2017

[Wine-Staging 2.3]Daz Studios 4.9.0.166 and PostgreSQL CMS on Linux

Daz Studio and PostgreSQL CMS

Daz Studio 4.9 uses PostgreSQL CMS (a module) to store data. It is a database (backend database). Due to admin privileges being too high with wine, we can NOT install and star the PostgreSQL database provided with. We need less privileges.

HOWEVER even if Wine is not able to install the PostgreSQL database -- as a simple workaround -- we can install a PostgreSQL database natively on Linux . Let's first check which PostgreSQL version is used by Daz Studio

PostgreSQL version used by Daz Studio

We have
  • For the version
    david@amdgaming:/opt/Builds/wine/data/Daz_Studio/drive_c/Program Files/DAZ 3D$ wine "${WINEPREFIX}/drive_c/Program Files/DAZ 3D/PostgreSQL CMS"/bin/psql.exe --version
    psql (PostgreSQL) 9.3.4
  • For the options
    david@amdgaming:/opt/Builds/wine/data/Daz_Studio/drive_c/Program Files/DAZ 3D$ wine"${WINEPREFIX}/drive_c/Program Files/DAZ 3D/PostgreSQL CMS"/bin/pg_config --configure
    --enable-thread-safety --enable-integer-datetimes --enable-nls --with-ldap --with-ossp-uuid --with-libxml --with-libxslt --with-tcl --with-perl --with-python
    

Daz Studio used PostgreSQL 9.3.4.

Build PostgreSQL 9.3.4 from sources

Let's build PostgreSQL 9.3.4 from sources

Notice: I took decision to not install PostgreSQL by my packages software (apt-get) because PostgreSQL version can be too old or too recent

sudo su
wget "https://ftp.postgresql.org/pub/source/v9.3.4/postgresql-9.3.4.tar.bz2"
tar xvjf postgresql-9.3.4.tar.bz2 
apt-get install libossp-uuid-dev libperl-dev libpython-dev
cd postgresql-9.3.4
./configure --prefix=/opt/PostgreSQL/9.3.4 --enable-thread-safety --enable-integer-datetimes --enable-nls --with-ldap --with-ossp-uuid --with-libxml --with-libxslt  --with-perl --with-python
make -j4
make install
cd contrib/
make -j4
make install

Configure the PostgreSQL cluster

  • Log out and get back to your current Linux user
  • Update your environment variables PATH and LD_LIBRARY_PATH to include paths to its bin and lib folder.
    export PATH=/opt/PostgreSQL/9.3.4/bin/:$PATH
    export LD_LIBRARY_PATH=/opt/PostgreSQL/9.3.4/lib/:$LD_LIBRARY_PATH
  • Then initialize the PostgreSQL cluster
    initdb -A trust /home/david/daz_studio_cms
Apply recommendations from http://amyaimei.deviantart.com/journal/Install-DAZ-Studio-4-9-0-63-32-bit-on-Linux-593421068
  • Here is the content of my PostgreSQL configuration file /home/david/daz_studio_cms/postgresql.conf without comments
    david@amdgaming:~$ grep -E '^[a-z]' /home/david/daz_studio_cms/postgresql.conf|sed -e "s:\#.*::g"
    max_connections = 100			
    shared_buffers = 512MB			
    temp_buffers = 30MB			
    log_destination = 'stderr'		
    logging_collector = on		
    log_directory = 'pg_log'		
    log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'	
    log_connections = on
    log_line_prefix = '%t [%a] [database=%d user=%u host=%h pid=%p]\n'			
    log_timezone = 'Europe/Paris'
    stats_temp_directory = 'pg_stat_tmp'
    datestyle = 'iso, dmy'
    timezone = 'Europe/Paris'
    lc_messages = 'fr_FR.UTF-8'			
    lc_monetary = 'fr_FR.UTF-8'			
    lc_numeric = 'fr_FR.UTF-8'			
    lc_time = 'fr_FR.UTF-8'				
    default_text_search_config = 'pg_catalog.french'
    
  • Start the PostgreSQL server
    /home/david/daz_studio_cms
  • Create a temporary file with the following content
    david@amdgaming:~$ cat zozo.sql 
    CREATE ROLE dzcms LOGIN SUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION;
    
    CREATE DATABASE "Content" WITH OWNER = dzcms ENCODING = 'UTF8' TABLESPACE = pg_default  CONNECTION LIMIT = -1;
    
    \c Content
    
    CREATE EXTENSION citext
     SCHEMA public
     VERSION "1.0";
    
    ALTER ROLE dzcms
     SET search_path = dzcontent, public;
    
  • Apply it. Using psql its output should be similar to below output
    david@amdgaming:~$ psql postgres -e -f zozo.sql
    CREATE ROLE dzcms LOGIN SUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION;
    CREATE ROLE
    CREATE DATABASE "Content" WITH OWNER = dzcms ENCODING = 'UTF8' TABLESPACE = pg_default  CONNECTION LIMIT = -1;
    CREATE DATABASE
    Vous êtes maintenant connecté à la base de données « Content » en tant qu'utilisateur « david ».
    CREATE EXTENSION citext
     SCHEMA public
     VERSION "1.0";
    CREATE EXTENSION
    ALTER ROLE dzcms
     SET search_path = dzcontent, public;
    ALTER ROLE
    

PostgreSQL CMS - Installation

  • While PostgreSQL CMS is still being downloaded from the main manager (see below image)

    PostgreSQL CMS is stillbeing downloaded
    Daz Studio has just written a file = ${WINEPREFIX}/drive_c/users/${YOUR_USER}/Application\ Data/DAZ\ 3D/cms/cmscfg.json
  • Replace its content by this one
    {
    	"Port" : 5432,
    	"ConnectionURI" : "postgresql://dzcms@localhost:5432/Content"
    }
    
Then PostgreSQL CMS installation should be fine!

jeudi 16 mars 2017

Wine Configure |Resort options in alphabetical order

Here is the command line I used to sort wine switches/options

  • WITH Gallium-Nine support and Without HAL support
    echo  $(echo -n $(./configure --help|grep -E '  \-\-with'|grep -vE '(PACKAGE|\-wine)'|sort|sed -e "s:without:with:g;s:with-hal:without-hal:g"|awk '{print $1}'|sort)) | \
    sed -e "s:--with-d3d9-nine-headers-path --with-d3d9-nine-module:--with-d3d9-nine-module=auto --with-d3d9-nine-headers-path=auto:g"
    Should print something like
    --with-alsa --with-capi --with-cms --with-coreaudio --with-cups --with-curses --with-d3d9-nine --with-d3d9-nine-module=auto --with-d3d9-nine-headers-path=auto \
    --with-dbus --with-fontconfig --with-freetype --with-gettext --with-gettextpo --with-glu --with-gnutls --with-gphoto --with-gsm --with-gstreamer --with-gtk3 --with-jpeg --with-ldap \
    --with-mpg123 --with-netapi --with-openal --with-opencl --with-opengl --with-osmesa --with-oss --without-hal --with-pcap --with-png --with-pthread --with-pulse --with-sane --with-tiff \
    --with-udev --with-v4l --with-va --with-x --with-xattr --with-xcb --with-xcomposite --with-xcursor --with-xinerama --with-xinput --with-xinput2 --with-xml --with-xrandr --with-xrender\
     --with-xshape --with-xshm --with-xslt --with-xxf86vm --with-zlib
  • WITHOUT Gallium-Nine support and Without HAL support if you use NVIDIA GPU
    echo  $(echo -n $(./configure --help|grep -E '  \-\-with'|grep -vE '(PACKAGE|\-wine)'|sort|sed -e "s:without:with:g;s:with-hal:without-hal:g"|awk '{print $1}'|sort)) 
    Should print something like
    --with-alsa --with-capi --with-cms --with-coreaudio --with-cups --with-curses --with-dbus --with-fontconfig --with-freetype --with-gettext --with-gettextpo --with-glu \
    --with-gnutls --with-gphoto --with-gsm --with-gstreamer --with-gtk3 --with-jpeg --with-ldap --with-mpg123 --with-netapi --with-openal --with-opencl --with-opengl --with-osmesa \
    --with-oss --without-hal --with-pcap --with-png --with-pthread --with-pulse --with-sane --with-tiff --with-udev --with-v4l --with-va --with-x --with-xattr --with-xcb --with-xcomposite \
    --with-xcursor --with-xinerama --with-xinput --with-xinput2 --with-xml --with-xrandr --with-xrender --with-xshape --with-xshm --with-xslt --with-xxf86vm --with-zlib