Some weirdness:
- If multiple, identical GPUs are present in the system, the same OpenCL kernel will be compiled for each of them.
No it does not. It compiles one kernel once for all similar hardware and then loads the binary from that point on. Since you have to run cgminer from the source directory currently, that's where it also stores the binary file.
So, I think I tracked down what led me to ask these questions.
My miner systems run without local disk and obtain everything over via PXE/TFTP/NFS. The directory where mining binaries (including cgminer) is installed isn't writable to the miner node users. Therefore, the binary output file can't be opened and, if I'm reading the source and the debug output correctly, the kernel is getting compiled memory-to-memory multiple times. Building to a temp directory would be one way to solve this.
In the process of troubleshooting, I found that adding the -T option to suppress curses output fails in a strange way with the latest linux binary. This works fine without -T, it's just hard to see everything that's going on as stuff scrolls up the curses window (and out of my scrollback):
box0202@box0202:/home/syadasti/software/cgminer-1.4.0$ ./cgminer --userpass user:pass --url http://pit.deepbit.net:8332 --debug -T
[2011-07-24 01:02:02] Testing pool http://pit.deepbit.net:8332
[2011-07-24 01:02:02] Successfully retrieved and deciphered work from pool 0 http://pit.deepbit.net:8332
[2011-07-24 01:02:02] Pool 0 http://pit.deepbit.net:8332 active
[2011-07-24 01:02:02] Init GPU thread 0
[2011-07-24 01:02:02] List of devices:
[2011-07-24 01:02:02] 0 Cypress
[2011-07-24 01:02:02] 1 Cypress
[2011-07-24 01:02:02] 2 Cypress
[2011-07-24 01:02:02] Selected 0: Cypress
[2011-07-24 01:02:02] Preferred vector width reported 4
[2011-07-24 01:02:02] Max work group size reported 256
[2011-07-24 01:02:02] Long-polling activated for http://pit.deepbit.net:8332/listenChannel
[2011-07-24 01:02:02] No binary found, generating from source
[2011-07-24 01:02:02] Patched source to suit 2 vectors
[2011-07-24 01:02:02] cl_amd_media_ops found, patched source with BITALIGN
[2011-07-24 01:02:02] cl_amd_media_ops found, patched source with BFI_INT
*** glibc detected *** ./cgminer: free(): invalid next size (fast): 0x000000000125b4e0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x72606)[0x7f6482a69606]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x7f6482a6e33c]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x2f2a4e)[0x7f647e11ca4e]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x2edd55)[0x7f647e117d55]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x2ede4d)[0x7f647e117e4d]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x109ef6)[0x7f647df33ef6]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x138779)[0x7f647df62779]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x10a44c)[0x7f647df3444c]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(+0x15716a)[0x7f647df8116a]
/opt/ati-stream-sdk-v2.3-lnx64/lib/x86_64/libatiocl64.so(clBuildProgram+0x2aa)[0x7f647df1277a]
./cgminer[0x40dbd6]
./cgminer[0x40af56]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7f6482a15ead]
./cgminer[0x4030a9]
======= Memory map: ========
00400000-00437000 r-xp 00000000 00:19 14778946 /home/syadasti/software/cgminer-1.4.0/cgminer
00636000-00637000 r-xp 00036000 00:19 14778946 /home/syadasti/software/cgminer-1.4.0/cgminer
00637000-00638000 rwxp 00037000 00:19 14778946 /home/syadasti/software/cgminer-1.4.0/cgminer
00638000-00639000 rwxp 00000000 00:00 0
01237000-025ae000 rwxp 00000000 00:00 0 [heap]
7f6474000000-7f6474021000 rwxp 00000000 00:00 0
7f6474021000-7f6478000000 ---p 00000000 00:00 0
7f6478385000-7f6478592000 r-xp 00000000 00:1a 9551883 /opt/ati-stream-sdk-v2.3-lnx64/lib/gpu/builtins-gpucommon.bc
7f6478592000-7f64785c8000 r-xp 00000000 00:1a 9551881 /opt/ati-stream-sdk-v2.3-lnx64/lib/gpu/builtins-evergreen.bc
7f64785c8000-7f64785cd000 r-xp 00000000 00:11 8405097 /lib/x86_64-linux-gnu/libnss_dns-2.13.so
7f64785cd000-7f64787cc000 ---p 00005000 00:11 8405097 /lib/x86_64-linux-gnu/libnss_dns-2.13.so
7f64787cc000-7f64787cd000 r-xp 00004000 00:11 8405097 /lib/x86_64-linux-gnu/libnss_dns-2.13.so
7f64787cd000-7f64787ce000 rwxp 00005000 00:11 8405097 /lib/x86_64-linux-gnu/libnss_dns-2.13.so
7f64787ce000-7f64787e3000 r-xp 00000000 00:11 8405095 /lib/x86_64-linux-gnu/libnsl-2.13.so
7f64787e3000-7f64789e2000 ---p 00015000 00:11 8405095 /lib/x86_64-linux-gnu/libnsl-2.13.so
7f64789e2000-7f64789e3000 r-xp 00014000 00:11 8405095 /lib/x86_64-linux-gnu/libnsl-2.13.so
7f64789e3000-7f64789e4000 rwxp 00015000 00:11 8405095 /lib/x86_64-linux-gnu/libnsl-2.13.so
7f64789e4000-7f64789e6000 rwxp 00000000 00:00 0
7f64789e6000-7f64789f0000 r-xp 00000000 00:11 8405100 /lib/x86_64-linux-gnu/libnss_nis-2.13.so
7f64789f0000-7f6478bef000 ---p 0000a000 00:11 8405100 /lib/x86_64-linux-gnu/libnss_nis-2.13.so
7f6478bef000-7f6478bf0000 r-xp 00009000 00:11 8405100 /lib/x86_64-linux-gnu/libnss_nis-2.13.so
7f6478bf0000-7f6478bf1000 rwxp 0000a000 00:11 8405100 /lib/x86_64-linux-gnu/libnss_nis-2.13.so
7f6478bf1000-7f6478bfc000 r-xp 00000000 00:11 8405098 /lib/x86_64-linux-gnu/libnss_files-2.13.so
7f6478bfc000-7f6478dfb000 ---p 0000b000 00:11 8405098 /lib/x86_64-linux-gnu/libnss_files-2.13.so
7f6478dfb000-7f6478dfc000 r-xp 0000a000 00:11 8405098 /lib/x86_64-linux-gnu/libnss_files-2.13.so
7f6478dfc000-7f6478dfd000 rwxp 0000b000 00:11 8405098 /lib/x86_64-linux-gnu/libnss_files-2.13.so
7f6478dfd000-7f6478dfe000 ---p 00000000 00:00 0
7f6478dfe000-7f64795fe000 rwxp 00000000 00:00 0
7f64795fe000-7f64795ff000 ---p 00000000 00:00 0
7f64795ff000-7f6479dff000 rwxp 00000000 00:00 0
7f6479dff000-7f6479e00000 ---p 00000000 00:00 0
7f6479e00000-7f647a600000 rwxp 00000000 00:00 0
7f647a600000-7f647a602000 r-xp 00000000 00:14 8622573 /usr/lib/libXinerama.so.1.0.0
7f647a602000-7f647a801000 ---p 00002000 00:14 8622573 /usr/lib/libXinerama.so.1.0.0
7f647a801000-7f647a802000 rwxp 00001000 00:14 8622573 /usr/lib/libXinerama.so.1.0.0
7f647a802000-7f647a835000 r-xp 00000000 00:14 14033094 /usr/lib/libatiadlxx.so
7f647a835000-7f647a935000 ---p 00033000 00:14 14033094 /usr/lib/libatiadlxx.so
7f647a935000-7f647a93c000 rwxp 00033000 00:14 14033094 /usr/lib/libatiadlxx.so
7f647a94e000-7f647ad50000 rwxp 00000000 00:00 0
7f647ad50000-7f647ad51000 rwxs 22b79000 00:12 5350 /dev/ati/card2
7f647ad51000-7f647adb1000 rwxs 22b78000 00:12 5350 /dev/ati/card2
7f647adb1000-7f647adf1000 rwxs 00049000 00:12 5350 /dev/ati/card2
7f647adf1000-7f647b4f1000 rwxs 00026000 00:12 5350 /dev/ati/card2
7f647b4f1000-7f647b4f2000 rwxs 00025000 00:12 5350 /dev/ati/card2
7f647b4f2000-7f647b512000 rwxs febe0000 00:12 5350 /dev/ati/card2
7f647b512000-7f647b572000 rwxs 22b76000 00:12 5348 /dev/ati/card1
7f647b572000-7f647bc72000 rwxs 00016000 00:12 5348 /dev/ati/card1
7f647bc72000-7f647bcd2000 rwxs 22b74000 00:12 5337 /dev/ati/card0
7f647bcd2000-7f647bd12000 rwxs 00035000 00:12 5337 /dev/ati/card0
7f647bd12000-7f647c412000 rwxs 00006000 00:12 5337 /dev/ati/card0
7f647c412000-7f647c492000 rwxp 00000000 00:00 0
7f647c492000-7f647cc3a000 r-xp 00000000 00:14 14033101 /usr/lib/libaticaldd.so
7f647cc3a000-7f647cd39000 ---p 007a8000 00:14 14033101 /usr/lib/libaticaldd.so
7f647cd39000-7f647cd89000 rwxp 007a7000 00:14 14033101 /usr/lib/libaticaldd.so
7f647cd89000-7f647ce42000 rwxp 00000000 00:00 0
7f647ce42000-7f647ce47000 r-xp 00000000 00:14 8621866 /usr/lib/libXdmcp.so.6.0.0
7f647ce47000-7f647d046000 ---p 00005000 00:14 8621866 /usr/lib/libXdmcp.so.6.0.0
7f647d046000-7f647d047000 rwxp 00004000 00:14 8621866 /usr/lib/libXdmcp.so.6.0.0
7f647d047000-7f647d049000 r-xp 00000000 00:14 8621864 /usr/lib/libXau.so.6.0.0
7f647d049000-7f647d249000 ---p 00002000 00:14 8621864 /usr/lib/libXau.so.6.0.0
7f647d249000-7f647d24a000 rwxp 00002000 00:14 8621864 /usr/lib/libXau.so.6.0.0
7f647d24a000-7f647d25b000 r-xp 00000000 00:14 8622561 /usr/lib/libXext.so.6.4.0Aborted