Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sgx-startup.sh problem with bone-debian-8.7-iot-armhf-2017-03-19-4gb image #40

Closed
LucaVs opened this issue Mar 27, 2017 · 17 comments
Closed

Comments

@LucaVs
Copy link

LucaVs commented Mar 27, 2017

I'm using the latest Debian image:
bone-debian-8.7-iot-armhf-2017-03-19-4gb image

I followed the instruction from:
http://elinux.org/BeagleBoardDebian#SGX_BeagleBone.2FBeagleBone_Black
to get SGX available.

  1. I installed the latest 4.4 kernel (--bone-kernel --lts-4_4)
  2. I installed GFX_5.01.01.02.tar.gz .

It seems there's a problem with sgx-startup.sh .
When I reboot the BBB I can't find omaplfb module loaded.

@LucaVs
Copy link
Author

LucaVs commented Mar 27, 2017

After rebooting I executed the following command:

root@beaglebone:~# lsmod | grep omaplfb
(no result)
root@beaglebone:~# sh /etc/init.d/sgx-startup.sh  start
sgx: Starting PVR
/usr/local/bin/pvrsrvctl: SrvInit failed (already initialized?) (err=129)
root@beaglebone:~# lsmod | grep omaplfb
omaplfb                12142  0 
tilcdc                 26645  1 omaplfb
pvrsrvkm              155855  1 omaplfb

now it works.
It seems at boot time it can't start itself.

@LucaVs
Copy link
Author

LucaVs commented Mar 27, 2017

I can get SGX properly running by disabling startup execution of sgx-startup.sh

chmod -x sgx-startup.sh

and by adding the following lines to rc.local

sleep 5
sh /etc/init.d/sgx-startup.sh  start

without the sleep it doesn't starts.
It probably start too fast at boot time while it should wait for some services to start before...

@RobertCNelson
Copy link
Owner

this really needs to be converted to a systemd startup script, i bet it's waiting for rootfs to load.. ;)

@LucaVs
Copy link
Author

LucaVs commented Mar 28, 2017

I create a simple service:

[Unit]
  Description=SGX
  [Service]
  ExecStart=/bin/sh /etc/init.d/sgx-startup.sh start
  ExecStop=/bin/sh /etc/init.d/sgx-startup.sh stop
  Restart=on-failure
  RestartSec=10
  User=root
  [Install]
  WantedBy=multi-user.target

but it doesn't load at startup. I get the same error.
If I disable service and run it after login

systemctl start sgx-startup.service

it works...
what should it wait for?

@RobertCNelson
Copy link
Owner

in the unit:

After=local-fs.target

Regards,

@LucaVs
Copy link
Author

LucaVs commented Mar 28, 2017

Same error.
But I added some log and I get:

modprobe: ERROR: could not insert 'omaplfb': No such device

@LucaVs
Copy link
Author

LucaVs commented Mar 29, 2017

Could it depend on /dev/fb0 not ready at boot time?

@LucaVs
Copy link
Author

LucaVs commented Mar 29, 2017

I confirm, when script execute at boot time there isn't /dev/fb0 available.
How can I wait for /dev/fb0 ?

@LucaVs
Copy link
Author

LucaVs commented Mar 29, 2017

I solved by adding a "while" before modprobe :

while [ ! -e /dev/fb0 ]
do
  echo "wait fb0"
  sleep 1
done
modprobe omaplfb

RobertCNelson added a commit that referenced this issue Mar 29, 2017
fixes: #40
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
RobertCNelson added a commit that referenced this issue Mar 29, 2017
fixes: #40
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
@RobertCNelson
Copy link
Owner

@LucaVs thanks! merged that (and tested it)

@LucaVs
Copy link
Author

LucaVs commented Mar 29, 2017

👍
Thanks for your work!

@LucaVs LucaVs closed this as completed Mar 29, 2017
@tderensis
Copy link

I just tried following the instructions here: http://elinux.org/BeagleBoardDebian#SGX_BeagleBone.2FBeagleBone_Black

When I check for omaplfb using lsmod, I don't see it. However, I do see pvrsrvkm.

lsmod | grep pvrsrvkm
pvrsrvkm		4379100	0

Looking at the startup script, it looks like you also wait for pvrsrvkm.

while [ ! -d  /sys/class/pvr/pvrsrvkm/ ]
 do
 	echo "wait pvrsrvkm"
 	sleep 1
 done

It doesn't look like that path exists on my device, so the startup script gets stuck there.

@RobertCNelson
Copy link
Owner

@tderensis probally didn't install teh bone kernel:

http://elinux.org/BeagleBoardDebian#Mainline_.284.4.x_lts.29

Regards

@tderensis
Copy link

Ah, I didn't realize I needed the bone kernel. I currently am using:

Linux beaglebone 4.4.52-ti-r92 #1 SMP Sat Mar 11 01:40:33 UTC 2017 armv7l GNU/Linux

What are the differences between these kernels? I am currently using the Beaglebone Green Wireless and using sleep modes along with an RGB display. Does that kernel still support these features?

@RobertCNelson
Copy link
Owner

@tderensis the 4.4.x-ti kernel has the new SGX driver stack. It's EGL only, FBDEV got removed. to use it:

sudo apt install ti-sgx-ti335x-modules-`uname -r`
sudo depmod -a `uname -r`
sudo update-initramfs -uk `uname -r`

then this userspace:

git clone -b ti-img-sgx/1.14.3699939 git://git.ti.com/graphics/omap5-sgx-ddk-um-linux.git --depth=1

cd omap5-sgx-ddk-um-linux/

sudo su
export DISCIMAGE=/
export TARGET_PRODUCT=ti335x
make install
exit

#fix: libgbm.so.2 (one line:)
sudo ln -s /usr/lib/arm-linux-gnueabihf/libgbm.so.1 /usr/lib/arm-linux-gnueabihf/libgbm.so.2

sudo modprobe pvrsrvkm
sudo /usr/bin/pvrsrvctl --start --no-module

and that's as far as i've gotten.. your on your own.

@tderensis
Copy link

These steps worked to get the pvrsrvkm module installed and the pvrsrvctl program starts. If the new SGX driver stack only supports EGL, then should I be using weston if I want accelerated video using EGL? Or should I be able to use lxqt?

I tried weston, but it fails to start unless I run it with --use-pixman.

@tderensis
Copy link

I tried the same way that @LucaVs tried (following this) but the module fails to load on boot. The log output doesn't show much:

Apr 21 15:24:33 beaglebone systemd[1]: Starting LSB: Start daemon at boot time...
Apr 21 15:24:33 beaglebone sgx-startup.sh[716]: sgx: Starting PVR
Apr 21 15:24:34 beaglebone sgx-startup.sh[716]: /usr/local/bin/pvrsrvctl: SrvInit failed (already initialized?) (err=4)
Apr 21 15:24:35 beaglebone systemd[1]: sgx-startup.service: Control process exited, code=exited status=1
Apr 21 15:24:35 beaglebone systemd[1]: Failed to start LSB: Start daemon at boot time.
Apr 21 15:24:35 beaglebone systemd[1]: sgx-startup.service: Unit entered failed state.
Apr 21 15:24:35 beaglebone systemd[1]: sgx-startup.service: Failed with result 'exit-code'.

Starting it afterwards also does not work either. At that point the kernel starts spewing messages. One small difference I noticed is that my GFX that I created is named differently: GFX_5.01.01.02_es8.x.tar.gz. Also running the update_kernel script automatically installs ti-sgx-es8-modules-4.4.61-bone17. I believe this is needed, but I am not entirely sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants