Description of problem: Let's get the ball rolling on this one... http://fedoraproject.org/wiki/Features/SysVtoSystemd https://fedoraproject.org/wiki/Packaging:Guidelines:Systemd https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Created attachment 534124 [details] Native systemd service file for boinc-client
Hello, Thank you for this very good job. I was trying to do it by myself but unsuccessfully. This script is working fine on my system. However, there's still a problem : if you want to compute boinc projects with the graphic card, using cuda for instance, the graphic card is not recognized after a reboot, unless you restart the service manually. Origin of the problem : to have the graphic card recognized by boinc, the display manager should fully work before the start of the service. In the present script, it is only launched after the network. Solution tested : After=prefdm.service --> boinc was lauched but still too early Installation procedure : 1) save file into /etc/systemd/user/boinc-client.service 2) systemctl enable /etc/systemd/user/boinc-client.service Equipment : Fedora 16 64 bits Intel Q8200 4 Go RAM Nvidia 8400 GS Do you have an idea ? Many thanks GuL NB : GPU computing can also cause alerts with SElinux, but it's working fine here
(In reply to comment #2) > Hello, > Thank you for this very good job. I was trying to do it by myself but > unsuccessfully. This script is working fine on my system. > > However, there's still a problem : if you want to compute boinc projects with > the graphic card, using cuda for instance, the graphic card is not recognized > after a reboot, unless you restart the service manually. Change the [Install] line from... WantedBy=multi-user.target To WantedBy=graphical.target In the submitted unit file and see if that does not solve your issue.
(In reply to comment #2) > NB : GPU computing can also cause alerts with SElinux, but it's working fine > here Just file a report with the avc msg against selinux policy and Dan will fix that or help you fix that in your package. Oh and uhum does systemctl reload boinc-client.service work as intended?
(In reply to comment #3) > Change the [Install] line from... > WantedBy=multi-user.target > To > WantedBy=graphical.target > In the submitted unit file and see if that does not solve your issue. Here is the result of After=prefdm.service WantedBy=graphical.target [guillaume@gul ~]$ service boinc-client status cgset: the group can't be modified boinc-client.service - Berkeley Open Infrastructure Network Computing Client Loaded: loaded (/etc/systemd/user/boinc-client.service; enabled) Active: active (running) since Fri, 23 Dec 2011 10:13:50 +0100; 1min 18s ago Main PID: 1164 (boinc_client) CGroup: name=systemd:/system/boinc-client.service ├ 1164 /usr/bin/boinc_client --dir /var/lib/boinc ├ 1180 ../../projects/einstein.phys.uwm.edu/hsgamma_FGRP1... ├ 1182 ../../projects/einstein.phys.uwm.edu/hsgamma_FGRP1... ├ 1184 ../../projects/einstein.phys.uwm.edu/einsteinbinar... └ 1186 ../../projects/einstein.phys.uwm.edu/hsgamma_FGRP1... [guillaume@gul ~]$ service prefdm status Redirecting to /bin/systemctl status prefdm.service prefdm.service - Display Manager Loaded: loaded (/lib/systemd/system/prefdm.service; static) Active: active (running) since Fri, 23 Dec 2011 10:13:50 +0100; 1min 26s ago Main PID: 1163 (gdm-binary) CGroup: name=systemd:/system/prefdm.service ├ 1163 /usr/sbin/gdm-binary -nodaemon ├ 1171 /usr/libexec/gdm-simple-slave --display-id /org/gn... ├ 1178 /usr/bin/Xorg :0 -background none -verbose -auth /... └ 1383 /usr/bin/gnome-keyring-daemon --daemonize --login Prefdm is launched before boinc but its children are not. Maybe do we need to wait until gnome-keyring-daemon is started ? Is there a way to do this ? Perhaps by adding a sleep 10 ?
(In reply to comment #4) > Just file a report with the avc msg against selinux policy and Dan will fix > that or help you fix that in your package. When I installed Fedora 16 from zero, I had alerts on /dev/nvidiactl and I added the following selinux policy : allow boinc_t xserver_misc_device_t:chr_file { ioctl open }; allow boinc_t xserver_misc_device_t:chr_file { read write }; Now with selinux-policy-3.10.0-67.fc16 it seems to work without any alert and no boinc module present with selinux -l. --> OK > Oh and uhum does systemctl reload boinc-client.service work as intended? All right
Not following why/what the dependency is on Gnome-Keyring afaik GNOME Keyring is integrated with the user's login and it does not unlock anything until the user actually logs in could you explain it a bit further what the problem is here so I can better understand what we are racing with and what about KDE XFCE LXDE? Remove what ever you have added there ( like After=prefdm and I think it's safe to drop the network.target from there as well ) and just try this one. [Unit] Description=Berkeley Open Infrastructure Network Computing Client After=graphical.target [Service] Nice=10 User=boinc CPUShares=2 ControlGroup=cpu:/background ExecStart=/usr/bin/boinc_client --dir /var/lib/boinc ExecReload=/usr/bin/boinccmd --read_cc_config | sed -e "s/retval.*//" -e "N;s/\n//; [Install] WantedBy=graphical.target
Here's the unit with sleep added as you suggested but having to add it feels kinda hackish... [Unit] Description=Berkeley Open Infrastructure Network Computing Client After=graphical.target [Service] Nice=10 User=boinc CPUShares=2 ControlGroup=cpu:/background ExecStartPre=/bin/sleep 10 ExecStart=/usr/bin/boinc_client --dir /var/lib/boinc ExecReload=/usr/bin/boinccmd --read_cc_config | sed -e "s/retval.*//" -e "N;s/\n//; [Install] WantedBy=graphical.target
After=graphical.target WantedBy=graphical.target No sleep --> boinc-client PID=1151-1179, prefdm PID=1155-1373, GPU unrecognized After=graphical.target WantedBy=graphical.target ExecStartPre=/bin/sleep 10, PID=1139 --> boinc-client PID=1340-1447, prefdm PID=1141-1352, GPU OK (In reply to comment #7) > Not following why/what the dependency is on Gnome-Keyring afaik GNOME Keyring > is integrated with the user's login and it does not unlock anything until the > user actually logs in could you explain it a bit further what the problem is > here so I can better understand what we are racing with and what about KDE XFCE > LXDE? If I correctly understand, prefdm launches X11 wich initializes the display driver needed to recognize the GPU. When graphical or prefdm report completion, the driver is not initialized so the GPU is unrecognized. Maybe 10s is too much, I am trying with 1 or 3s.
(In reply to comment #2) > Hello, > Thank you for this very good job. I was trying to do it by myself but > unsuccessfully. This script is working fine on my system. > > However, there's still a problem : if you want to compute boinc projects with > the graphic card, using cuda for instance, the graphic card is not recognized > after a reboot, unless you restart the service manually. This comes on as a bit odd either what cuda is doing or boinc is doing is buggy/broken. > > Origin of the problem : to have the graphic card recognized by boinc, the > display manager should fully work before the start of the service. How does boinc detect the graphics card as in why do you have to restart boinc to detect the graphics card/cuda? Does this work as advertised if you are not using cuda ? Is cuda started in some special way for example started by a script which could not be fully initialized when boinc is started?
sleep 1 is ok, pb solved, thanks a lot. One more thing : prefdm is freezing sometimes. I need to restart it from the console. It was not the case before this script, and that's not due to the GPU computing as it is off when I am active and with a project that stop crunching immediately on demand (primegrid). If you need additional tests please tell me.
(In reply to comment #10) > This comes on as a bit odd either what cuda is doing or boinc is doing is > buggy/broken. I don't think so : it's working fine when the driver is previously initialized > How does boinc detect the graphics card as in why do you have to restart boinc > to detect the graphics card/cuda? I suppose that boinc don't address the nvidia driver itself but is speaking through X11. If X11 is not ready, boinc can't access the gpu and just report it is absent. That's the same if the drivers are not properly installed nor the cuda toolkit. > Does this work as advertised if you are not using cuda ? Yes, no problem > Is cuda started in some special way for example started by a script which could > not be fully initialized when boinc is started? No, but you need to install it separately with this protocol : # Cuda # http://developer.nvidia.com/cuda-toolkit-40 wget http://www.nvidia.com/object/thankyou.html?url=/compute/cuda/4_0/toolkit/cudatoolkit_4.0.17_linux_64_fedora13.run chmod u+x cudatoolkit_4.0.17_linux_64_fedora13.run ./cudatoolkit_4.0.17_linux_64_fedora13.run # Path update # /etc/profile.d/cuda.sh PATH=$PATH:/usr/local/cuda/bin # /etc/ld.so.conf.d/cuda-x86_64.conf /usr/local/cuda/lib64 /usr/local/cuda/lib
Created attachment 549338 [details] Native systemd service for boinc-client Fixes based on feed back
(In reply to comment #11) > sleep 1 is ok, pb solved, thanks a lot. > > One more thing : prefdm is freezing sometimes. I need to restart it from the > console. It was not the case before this script By script you mean the systemd unit as in the boinc-client.service or are you using some script? , and that's not due to the GPU > computing as it is off when I am active and with a project that stop crunching > immediately on demand (primegrid). Check logs .xsession errors for the user xorg and messages log files in /var/log Something should be saying something without knowing what causes the freeze there is not much that can be done. The prefdm service is set to restart always in the unit " Restart=always RestartSec=0" If set to always the service will be restarted regardless whether it exited cleanly or not, or got terminated abnormally by a signal. I'm pretty sure this might effect cuda and or the boinc client if prefdm suddenly is restarted. You are probably hitting some X bug here
(In reply to comment #14) > By script you mean the systemd unit as in the boinc-client.service or are you > using some script? boinc-client.service only > Check logs .xsession errors for the user xorg and messages log files in > /var/log nothing evident in the logs. I will check if it happens again > You are probably hitting some X bug here maybe, but it is almost not present, so that's not so disturbing
Can you try this one and boot into multi-user target just add 3 to the kernel commmand line in grub I'm hoping that it solves starting the service when you dont boot into graphical target ( runlevel 3 ) as well as work when you boot into graphical.target ( runlevel 5 ) And solves "we do not want to start boinc after X server (for CPU computing it does not make sense, it should be enough that you power on the machine)." comment 3 in bug 719878. As it is now the unit would only be started in graphical mode [Unit] Description=Berkeley Open Infrastructure Network Computing Client After=network.target graphical.target [Service] Nice=10 User=boinc CPUShares=2 ControlGroup=cpu:/background ExecStartPre=/bin/sleep 1 ExecStart=/usr/bin/boinc_client --dir /var/lib/boinc ExecReload=/usr/bin/boinccmd --read_cc_config | sed -e "s/retval.*//" -e "N;s/\n//; [Install] WantedBy=multi-user.target
and I'm pretty sure that the reload command is not working as expected since we are piping it into sed
(In reply to comment #16) > And solves "we do not want to start boinc after X server (for CPU computing it > does not make sense, it should be enough that you power on the machine)." > comment 3 in bug 719878. It works without gpu in runlevel 3 and with gpu in runlevel 5 (In reply to comment #17) > and I'm pretty sure that the reload command is not working as expected since we > are piping it into sed You're right : there is no error but the parameters are not reloaded. Is it really useful ? We can simply do a restart. And what about the CPUShares=2 line ? What happens if there is only one CPU or more than 2 ?
(In reply to comment #18) > (In reply to comment #16) > > And solves "we do not want to start boinc after X server (for CPU computing it > > does not make sense, it should be enough that you power on the machine)." > > comment 3 in bug 719878. > > It works without gpu in runlevel 3 and with gpu in runlevel 5 > > (In reply to comment #17) > > and I'm pretty sure that the reload command is not working as expected since we > > are piping it into sed > > You're right : there is no error but the parameters are not reloaded. Is it > really useful ? We can simply do a restart. And what about the CPUShares=2 > line ? What happens if there is only one CPU or more than 2 ? These are cpu time shares ( cgroup resources ) not the amount of cpu's and cores and it set to 2 as in receive twice the CPU time of tasks in a control group where cpu shares is set to 1. see http://docs.fedoraproject.org/en-US/Fedora/16/html/Resource_Management_Guide/ch01.html http://www.kernel.org/doc/Documentation/cgroups/ http://people.redhat.com/mingo/cfs-scheduler/sched-design-CFS.txt
Created attachment 549358 [details] Native systemd service for boinc-client Drop the reload command and fixed the service to start in multi-user target as well as graphical.target
Ok, great, have a merry christmas
Hello guys, thanks a lot for your work and sorry for not getting back earlier. I just built boinc-client for F17/F18 using the provided systemd unit. Milos
Many thanks Milos Hello Johann, Something is strange : the systemd service has been working well for a long time, is still working in runlevel 3, but not anymore in runlevel 5, since probably an update, on the same computer. systemctl status indicates that the service is enabled, launched but dead. If I restart it manually it works fine. If I use the init.d script instead, it starts. I tried also unsuccessfully to add the following lines in the service section of the systemd file Restart=always RestartSec=1 linux 3.2.9-1.fc16.x86_64 boinc-client.x86_64 6.12.35-1.r24014svn.fc16 selinux-policy.noarch 3.10.0-75.fc16 Any ideas ? Cheers