-
Notifications
You must be signed in to change notification settings - Fork 42
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
Trouble compiling on Pi 4 #743
Comments
You can try to use a prebuilt libclc to reduce the build load. Build libclc on something else than a raspberry pi: Copy
|
Thanks, I just tried that. I couldn't figure out how to just compile clspv, so I just compiled the whole clvk project on a fast Linux computer, and found the clspv files, and copied them over to the Pi 4. Then I ran:
|
It feels like |
I had put them in ../libclc, but I also tried putting them in external/clspv/libclc, but with the same results. I'm guessing it's not as simple as just copying the clspv--.bc over from something I built on another platform. Looking at the readme compilation of clspv is under cross-compilation, so I'm assuming I need to do something with cross-compilation? Unfortunately those instructions on the readme are not clear to me. I gave it a go, and on the x64 machine I created a folder clang_host and ran the cmake command, but get the error |
Alright, then the issue is |
Nice! Looks like that worked well, I was finally able to complete the compilation and it's working. Thanks! |
Unfortunately while it compiled, and the software shows a selectable V3D option, it doesn't seem to actually work. I ran ./simple_test and got: Platform: clvk Interestingly, it also seems to have failed on my Ubuntu laptop, as I get the same error on it: Platform: clvk I guess the clspv--.bc I compiled on the laptop must be not working? |
I would not expect the libclc binaries to be the issue here, but it's not impossible. Could you run it with the following environment variables set:
and upload |
Thanks, here is the output on my Ubuntu 22.04 laptop. Will get the Pi 4 one later. |
hum, I see. you can either remove that file. Or run the binary from another repo. |
We should fix this. There's no reason for this broken config file ending up in the default location :). |
Add the path to the config files in the sources instead. Ref kpet#743
Thanks, that does fix the issue with the test not running. The test works fine now. However, I'm still having issues getting a kernel to run from a program I'm trying to test clvk with. I'm not entirely sure if it's the kernel that is incompatible, or something wrong with my clvk install (or probably both), but the error I currently get makes it seem like my clvk install is not right. First, this is my command to start the software (I tried both clspv64 and clspv - not sure which one I should use but they both give the same error):
When running something that uses the GPU the error is:
The error made me think it's something to do with the system clang version so later I manually installed llvm20/clang20 and tried to recompile clvk on a Pi 5 (which BTW unlike the Pi 4 can complete the entire compilation when using the default clang with
|
Add the path to the config files in the sources instead. Ref kpet#743
You should not need to define |
Add the path to the config files in the sources instead. Ref kpet#743
Add the path to the config files in the sources instead. Ref kpet#743
Ah okay that's my bad I must have misunderstood the readme. When running without CLVK_CLSPV_PATH, I still end up with warnings and error building, but it might be kernel compatibility related:
Previously I tried fixing these warnings as they were just simple C issues, but ultimately I still ended up with:
And then no additional error message or warnings given. I guess it's just that this kernel would need some work to be compatible with the limitations of clvk and clspv? https://github.com/SatDump/SatDump/blob/master/resources/opencl/warp_image_thin_plate_spline_fp32.cl But I also tried stripping down the kernel to just an empty function to see if it could at least not give an error, and it still wouldn't compile without the same error. I admit I don't really know what I'm doing here with the Kernel though, or if the errors I'm getting are SatDump related, or clvk related.
Is there any way to just compile the kernel with clvk or clspv standalone, outside of the SatDump software? Then at least I can confirm if the kernel is compatible or not. |
Please provide an updated |
Ah looks like support is missing for Int16? |
Also I just want to add another observation. When I run SatDump with clvk and the same kernel on my Intel laptop, it compiles, runs, and finishes. But no final image is generated for some reason. The warped image is just not there. If I run the warp on the Intel laptop without clvk, using the native OpenCL implementation, it works fine. The same problem with the image not appearing happens on the Raspberry Pi 4/5 and Intel Laptop if I try to run it with llvmpipe. I'll attach clvk.log for a llvmpipe run on the Pi 4 just in case it helps. |
The reason for the failure you have right now is because the Vulkan driver that But you have 2 Vulkan implementations on your platform:
I think what you want is to use |
I'm fairly certain it is using V3D. In the SatDump software I can choose between V3D and llvmpipe as the OpenCL device to use. Choosing V3D yields the first clvk.log I posted, and the GPU building error. Choosing llvmpipe, yields the second clvk.log I posted. No error, but no image. |
Alright, then your issue with For the issue with llvmpipe, I don't see anything in the log. |
Add the path to the config files in the sources instead. Ref #743
* Add SPIRV Capabilities error in build logging Ref #743 * Update src/program.cpp Co-authored-by: Kévin Petit <[email protected]> * Update src/program.cpp --------- Co-authored-by: Kévin Petit <[email protected]>
Hi, the docs say this can be built on a Raspberry Pi, but I've been trying to compile this on a Pi 4 running Ubuntu 24.10 for the last few days without luck. Running on a 64GB SD card which I hope is big enough.
I've managed to get a little further each time with some fixes:
First I couldn't run fetch_sources as Git simply did not want to download llvm as I think it's too big. Using --shallow helped.
I kept getting an error
cc: error: unrecognized command-line option
during make. It seems that the compiler it was trying to use was gcc by default. I forced it to use clang by adding-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
to cmake.I have the Pi 4 2GB and 8GB models. At first I tried the 2GB model, and the compilation just kept crashing and causing the entire board to restart. Switching to the 8GB model helped me compile to a higher percentage, but it still crashed either with a reset, or just the terminal window closing. I then increased the swap space to 16GB, and again that got me further, but I still end up with a crash, or just with the terminal window closing itself without completion.
I tried
cmake ../ -DCLVK_BUILD_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_ENABLE_BINDINGS=OFF -DLLVM_ENABLE_UNWIND_TABLES=OFF-DLLVM_BUILD_TOOLS=OFF -DCLSPV_BUILD_SPIRV_DIS=OFF -DCLSPV_BUILD_TESTS=OFF -DCLVK_BUILD_TESTS=OFF -DCLVK_BUILD_SPIRV_TOOLS=OFF -DCLVK_ENABLE_SPIRV_IL=OFF -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
to try and cut down on some of the things that need to compile, but at some point during an overnight compile the terminal window just closes itself, and the compilation never completes.Running
make -j1
to force one core seems to help to get it a little further, but ultimately I still end up with a reset or terminal window close.The culprit appears to be that it never gets past the llvm compilation. One guess I have is that the crashes are from running out of memory, but I've never seen the ram bar full during compilation with htop up, though the crashes always occur when I leave it running overnight so I may be missing it.
I am Interested to hear if anyone has anything else I should try, or if anyone else had it successfully installed on a Pi 4 recently?
The text was updated successfully, but these errors were encountered: