Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 2424  / 2 Years ago, tue, august 23, 2022, 1:33:41

I run some opencl applications on 2x AMD Radeon HD 7870 on a machine running Ubuntu 13.10.



I power the machine on and lightdm has the login prompt. Since I cannot physically be present to login to the machine everytime I power cycle it. I want to troubleshoot why Opencl does not detect the GPU following a power cycle on the machine.



Without logging in in lightdm , if I ssh into the machine and start the opencl jobs.
Opencl does not "see" the GPU.



Only If I login to the machine by being physically present and logging into lightdmdoes the remote shell "see" the GPU.



I dont know much about openCL to provide more information, but this seems to be something about how ubuntu initializes. What does logging in to the lightdm console ..do to the state of the graphics driver.



Is there some way to "load" the driver to have OpenCL see it.



Strangely lsmod shows "fglrx" loaded and in use when Opencl fails to "see" the GPU.



#

State without loggin into lightdm and as reported by a ssh session



#

   hari@hjubuntu:~$ ~/oepncl-program

Available device list:
Type: CPU, 'Intel(R) Core(TM)2 Quad CPU Q9450 @ 2.66GHz'


hari@hjubuntu:~$ lsmod
Module Size Used by
pci_stub 12622 1
vboxpci 23194 0
vboxnetadp 25670 0
vboxnetflt 27613 0
vboxdrv 320455 3 vboxnetadp,vboxnetflt,vboxpci
cuse 13274 3
dm_crypt 22832 0
kvm_intel 138567 0
kvm 431754 1 kvm_intel
gpio_ich 13476 0
ppdev 17671 0
snd_usb_audio 149162 2
bnep 19704 2
snd_usbmidi_lib 25070 1 snd_usb_audio
rfcomm 69130 0
bluetooth 372041 10 bnep,rfcomm
snd_hda_codec_hdmi 41154 2
microcode 23656 0
psmouse 97655 0
snd_hda_codec_realtek 56475 1
serio_raw 13413 0
snd_seq_midi 13324 0
snd_hda_intel 52267 7
snd_seq_midi_event 14899 1 snd_seq_midi
snd_hda_codec 188738 3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel
snd_rawmidi 30095 2 snd_usbmidi_lib,snd_seq_midi
snd_hwdep 13602 2 snd_usb_audio,snd_hda_codec
lpc_ich 21080 0
snd_pcm 102033 4 snd_usb_audio,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
snd_seq 61560 2 snd_seq_midi_event,snd_seq_midi
snd_page_alloc 18710 2 snd_pcm,snd_hda_intel
snd_seq_device 14497 3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer 29433 2 snd_pcm,snd_seq
fglrx 8815330 48
snd 69141 31 snd_hda_codec_realtek,snd_usb_audio,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_rawmidi,snd_usbmidi_lib,snd_hda_codec,snd_hda_intel,snd_seq_device,snd_seq_midi
it87 43113 0
hwmon_vid 12783 1 it87
parport_pc 32701 1
coretemp 13435 0
x38_edac 12898 0
soundcore 12680 1 snd
lp 17759 0
parport 42299 3 lp,ppdev,parport_pc
binfmt_misc 17468 1
mac_hid 13205 0
amd_iommu_v2 19054 1 fglrx
edac_core 62342 1 x38_edac
vesafb 13828 1
pata_acpi 13038 0
hid_generic 12548 0
usbhid 53014 0
hid 101762 2 hid_generic,usbhid
firewire_ohci 40327 0
firewire_core 64534 1 firewire_ohci
crc_itu_t 12707 1 firewire_core
r8169 67581 0
mii 13934 1 r8169
pata_jmicron 12758 0
ahci 25819 0
libahci 32009 1 ahci
floppy 69370 0


After the user logs in and I run the same program.



#

State after loggin in to lightdm and starting the desktop environment



#

hari@hjubuntu:~$ ~/opencl-program
Available device list:
Type: CPU, 'Intel(R) Core(TM)2 Quad CPU Q9450 @ 2.66GHz'
Type: GPU, 'Pitcairn'
Type: ACCELERATOR, 'Pitcairn'


Now If I do a diff of the lsmod
What I get is



hari@hjubuntu:~$ diff before_login after_login | grep fglrx
< fglrx 8815330 48
< amd_iommu_v2 19054 1 fglrx
> fglrx 8815330 44
> amd_iommu_v2 19054 1 fglrx


SO logging in caused the fglrx driver to get used by "44". How do I mimic this so I got have to log in when someone remote-power cycles this machine?.



edit: I am trying to implement the script below and always get a



"hari@hjubuntu:~$ xauth extract "$DISPLAY"
xauth: (argv):1: bad "extract" command line"


The $DISPLAY environment label is blank



hari@hjubuntu:~$ echo $DISPLAY


xauth list gives



hjubuntu/unix:1  MIT-MAGIC-COOKIE-1  8562e9f6ac976f310d1425aa11e74184
hjubuntu:0 MIT-MAGIC-COOKIE-1 80f5f4c28e7e2d0fc9444b1862f5cbcb
hjubuntu:0 MIT-MAGIC-COOKIE-1 80f5f4c28e7e2d0fc9444b1862f5cbcb
hjubuntu/unix:13 MIT-MAGIC-COOKIE-1 142c11b5689f4bd2776e860b9d8719dd
hjubuntu/unix:14 MIT-MAGIC-COOKIE-1 08353f652f21b479a6da3a60282bce31
hjubuntu/unix:15 MIT-MAGIC-COOKIE-1 655d074dfb395f536283e70a9494428c
hjubuntu/unix:12 MIT-MAGIC-COOKIE-1 91387509c2dff960e295fdd0eb0ada52
hjubuntu/unix:11 MIT-MAGIC-COOKIE-1 914c7988660149b90eed958066ed2e71
hjubuntu/unix:10 MIT-MAGIC-COOKIE-1 0ab65dbaf838a08bd8c9141fb5da7c35


Wondering how I should proceed.


More From » drivers

 Answers
0

Often some features of the hardware are not initialised until they are needed - e.g. extra display ports etc, so it is likely in this case that actually running something which uses the relevant hardware on the card is needed to turn it on.



The cheapest/simplest way to do this is to turn on the Auto-login feature (Settings>User Accounts). It won't matter what account you do this from, so you could even use a guest account if you are worried about security.



If that is not enough (there may be permissions problems), you can share the xauthority. Just add something like this to the end of your lightdm script:



xauth extract /tmp/auth-file "$DISPLAY"
chmod 660 /tmp/auth-file
chgrp users /tmp/auth-file
cat > /tmp/gpuenable <<EOF
export COMPUTE=$DISPLAY
unset DISPLAY
export XAUTHORITY=/tmp/auth-file
EOF


then when you login remotely you just need to run /tmp/gpuenable before any OpenCL code. Change the group name "users" to any group you want to have access.



P.S. this isn't Ubuntu-specific, or really, even Linux specific, it is just that most other OSes have the display running all the time.


[#24737] Tuesday, August 23, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ainubt

Total Points: 496
Total Questions: 98
Total Answers: 126

Location: Sao Tome and Principe
Member since Wed, Dec 21, 2022
1 Year ago
;