How to Install GPU binary driver

From XApple
Jump to: navigation, search

Contents

How to install GPU binary driver

This document explain how to Install GPU binary driver

you probably have two choices, choose which of the most convenient way yourself here

  1. install to prebuilt image, then flash to micro sd card later. this don't require a target board, neither require OS running on target board
  2. install to target board directly while the debian/ubuntu OS is up and running

Install to prebuilt image on S500 platform (don't require bring OS up on target board)

If you already have one released image for the target board, you can directly install GPU driver into this image.

Here shows the steps of PowerVR SGX544 GPU driver replacement.

(Caution: the GPU replacement will have its own Xorg version (and other open source packages) installed at path /usr/local/XSGX

which will replace the one provided by OS distribution, it's not a decent way for the open source development,

but this is so far what we've got from the DDK provider, so don't blame us..)

Note:

  • the "(host)" prompt indicate all the commands you running at host computer,
    • it's probably a x86 hardware machine, running Ubuntu/Debian/Fedora/Gentoo, or whatever Linux System
  • the "(boards)" prompt indicate all the commands you running at target board
    • it's probably a s500 arm board, maybe roseapple pi board, or lemaker guitar board
(host) # parted -s debian-s500-20151130.img unit s print
Warning: Not all of the space available to debian-s500-20151019.img appears to be used, you can fix the GPT to use all of the space (an extra 475136 blocks) or 
continue with the current setting? 
Model:  (file)
Disk debian-s500-20151130.img: 15155200s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start    End        Size       File system  Name  Flags
 1      2048s    32734s     30687s
 2      32768s   106496s    73729s     fat32              boot, esp
 3      139264s  14680030s  14540767s  ext4

the rootfs partition (ext4) start at 139264s, with size 14540767s

(host) # LOOPDEV=$(losetup -f)
(host) # losetup --offset $((139264*512)) --sizelimit $((14540767*512)) ${LOOPDEV} debian-s500-20151130.img
(host) # mount ${LOOPDEV} /mnt/debian/


1) get the prebuilt GPU DDK binary image:

(host) download from https://drive.google.com/file/d/0B7FA1sot2jVleG42M0ZyNkJnclk/view?usp=sharing 

or wget http://mirror.lemaker.org/GPU_For_LeMaker_Guitar_201511.tar.gz because the GPU is the same inside the S500 SoC

2) unpack the tarball, please run following command on the host board

(host) # tar jxvf gpu_v2_1118.tar.bz2

3) patch the original script released from Actions

(host) https://drive.google.com/file/d/0B7FA1sot2jVlT191U3kzdEFuY00/view?usp=sharing
(host) # cp install.sh v2/

Note: Remember to change the permission to this install.sh file.

(host) # cd v2 && ./install.sh -v --root /mnt/debian
Edit /mnt/debian/etc/xorg.conf, add two Option XVHWOverlay and SWCursor

(host) vi /mnt/debian/etc/xorg.conf
Section "Device"
        Identifier      "Video Device"
        Driver          "pvr"
        Option          "FlipChain"     "true"
        Option          "XVHWOverlay"   "false"
        Option          "SWCursor"      "true"
EndSection

Section "Monitor"
        Identifier      "Monitor"
EndSection

Section "Screen"
        Identifier      "Screen"
        Monitor         "Monitor"
        Device          "Video Device"
EndSection
(host) # umount /mnt/debian

4) after first boot update lib path

(board) $ sudo ldconfig

Install to the target board directly (require system up and running)

If you already flashed the firmware to micro sd card,

then you can install GPU binary driver into the target board which it's up and running

1) get the prebuilt GPU DDK binary image and modified installation script:

 (host) download from https://drive.google.com/file/d/0B7FA1sot2jVleG42M0ZyNkJnclk/view?usp=sharing 
   or get from lemaker's website, because the GPU is the same inside the S500 SoC
 (host) wget http://mirror.lemaker.org/GPU_For_LeMaker_Guitar_201511.tar.gz

 (host) https://drive.google.com/file/d/0B7FA1sot2jVlT191U3kzdEFuY00/view?usp=sharing

if you download the above two files at host computer, then you have to transfer them to the target board

2) unpack the tarball, please run following command on the host board

(board) # tar jxvf gpu_v2_1118.tar.bz2

3) replace the original script which released from Actions with our patched script

(board) # cp install.sh v2/

Note: Remember to change the permission to this install.sh file.

(board) # cd v2 && ./install.sh -v --root /
(board) # Add two Option in the file /etc/xorg.conf  (XVHWOverlay and SWCursor)
Section "Device"
        Identifier      "Video Device"
        Driver          "pvr"
        Option          "FlipChain"     "true"
        Option          "XVHWOverlay"   "false"
        Option          "SWCursor"      "true"
EndSection

Section "Monitor"
        Identifier      "Monitor"
EndSection

Section "Screen"
        Identifier      "Screen"
        Monitor         "Monitor"
        Device          "Video Device"
EndSection

4) after first boot update lib path

(board) $ sudo ldconfig

Additional useful Steps

boot the system on the target board, and run following commands

  1. note: create a common user and add it to video group
(boards) # useradd -d /home/user -G video -s /bin/bash user
(boards) # mkdir -p /home/user
(boards) # chown -R dennis /home/user
(boards) # passwd user
 < then, type your password .. >

you can change user to whatever user name you like

  1. or if the user is already created, then simply add it to video group
(boards) # gpasswd -a user video
Personal tools
Namespaces

Variants
Actions
Navigation
Tools