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
media-libs/opensubdiv: use cuda eclass #22852
Conversation
* Utilize cuda eclass and let it handle gcc selection instead of forcing an outdated version. * Add a fix to provide sane defaults when compiling against a recent enough CUDA versions. * Add an option to pass user-specified NVCCFLAGS and prevent cmake from overriding them. Closes: https://bugs.gentoo.org/744517 Closes: https://bugs.gentoo.org/751382 Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
Pull Request assignmentSubmitter: @Fat-Zer media-libs/opensubdiv: @redchillipadi, @gentoo/proxy-maint Linked bugsIn order to force reassignment and/or bug reference scan, please append Docs: Code of Conduct ● Copyright policy (expl.) ● Devmanual ● GitHub PRs ● Proxy-maint guide |
Pull request CI reportReport generated at: 2021-11-07 00:10 UTC There are existing issues already. Please look into the report to make sure none of them affect the packages in question: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+cuda
seems to fail for me, not sure if it's because I don't have an nvidia card. Please see:
https://cpy.pt/yUHZ4rq8?raw
("exit_code": 1,
means failure)
#$ "/usr/x86_64-pc-linux-gnu/gcc-bin/11.2.0"/gcc -D__CUDA_ARCH__=350 -D__CUDA_ARCH_LIST__=350 -E -x c++ -DCUDA_DOUBLE_MATH_FUNCTIONS -D__CUDACC__ -D__NVCC__ "-march=native" "-O2" "-pipe" "-frecord- gcc-switches" -march=native -O2 -pipe -frecord-gcc-switches -fPIC -O2 -I"/opt/cuda/include" -I"/var/tmp/portage/media-libs/opensubdiv-3.4.4-r2/work/OpenSubdiv-3_4_4/opensubdiv" -I"/usr/include" -I"/ var/tmp/portage/media-libs/opensubdiv-3.4.4-r2/work/OpenSubdiv-3_4_4/glLoader" "-I/opt/cuda/bin/../ targets/x86_64-linux/include" -D "OPENSUBDIV_VERSION_STRING="3.4.4"" -D "OPENSUBDIV_HAS_OPENGL" -D "OSD_USES_INTERNAL_GLAPILOADER" -D "GLFW_VERSION_3" -D "OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK" -D "OPENSUBDIV_HAS_GLSL_COMPUTE" -D "OPENSUBDIV_HAS_CUDA" -D "CUDA_ENABLE_DEPRECATED=0" -D "NVCC" -D__CUDACC_VER_MAJOR__=11 -D__CUDACC_VER_MINOR__=5 - D__CUDACC_VER_BUILD__=50 -D__CUDA_API_VER_MAJOR__=11 -D__CUDA_API_VER_MINOR__=5 - D__NVCC_DIAG_PRAGMA_SUPPORT__=1 -include "cuda_runtime.h" -m64 "/var/tmp/portage/media-libs/ opensubdiv-3.4.4-r2/work/OpenSubdiv-3_4_4/opensubdiv/osd/cudaKernel.cu" -o "/var/tmp/portage/media- libs/opensubdiv-3.4.4-r2/temp/tmpxft_0000016c_00000000-7_cudaKernel.cpp1.ii"
#$ cicc --c++17 --gnu_version=110200 --display_error_number --orig_src_file_name "/var/tmp/portage/ media-libs/opensubdiv-3.4.4-r2/work/OpenSubdiv-3_4_4/opensubdiv/osd/cudaKernel.cu" -- orig_src_path_name "/var/tmp/portage/media-libs/opensubdiv-3.4.4-r2/work/OpenSubdiv-3_4_4/ opensubdiv/osd/cudaKernel.cu" --allow_managed -arch compute_35 -m64 --no-version-ident -ftz=0 - prec_div=1 -prec_sqrt=1 -fmad=1 --include_file_name "tmpxft_0000016c_00000000-3_cudaKernel.fatbin. c" -tused --gen_module_id_file --module_id_file_name "/var/tmp/portage/media-libs/opensubdiv-3.4.4- r2/temp/tmpxft_0000016c_00000000-4_cudaKernel.module_id" --gen_c_file_name "/var/tmp/portage/media- libs/opensubdiv-3.4.4-r2/temp/tmpxft_0000016c_00000000-6_cudaKernel.cudafe1.c" --stub_file_name "/ var/tmp/portage/media-libs/opensubdiv-3.4.4-r2/temp/tmpxft_0000016c_00000000-6_cudaKernel.cudafe1. stub.c" --gen_device_file_name "/var/tmp/portage/media-libs/opensubdiv-3.4.4-r2/temp/ tmpxft_0000016c_00000000-6_cudaKernel.cudafe1.gpu" "/var/tmp/portage/media-libs/opensubdiv-3.4.4- r2/temp/tmpxft_0000016c_00000000-7_cudaKernel.cpp1.ii" -o "/var/tmp/portage/media-libs/opensubdiv-3.4.4-r2/temp/tmpxft_0000016c_00000000-6_cudaKernel.ptx"
/usr/include/stdio.h(183): error: attribute "malloc" does not take arguments
@juippis, hmmm... I can't reproduce it, could you share your PS: I haven't tried to build it on a system without an nvidia GPU, but it shouldn't fail... |
@Fat-Zer thanks for looking into it!
|
Ok... looks like it's a CUDA issue caused by combination of If it's so, I believe it shouldn't be touched in the opensubdiv ebuild. It can be either ignored (in hope for a sooner CUDA release) or mitigated in the cuda eclass/ebuild (if several other packages are affected). It probably could be worked around by emerging Though, I need a bit more testing to insure it's the issue and that the workarounds work. I suspect other packages that precompile CUDA kernels would be affected as well. The good candidate is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ionenwks ^ would you have an idea to the nvidia related things?
Somehow if we know stuff is broken, we should try to workaround then. I'm kind of uncomfortable merging this before we know what the root cause is.
Let me know what I can test, with my amdgpu. If either of tell me everything Just Works with nvidia, I'll believe you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juippis fwiw this package's IUSE=cuda been in a terrible state for a while either way, unlikely anyone been building it lately without looking up workarounds. Although being tossed a new -r2 to build that is known-failing also isn't that great :( No strong feeling about it but waiting for nvidia's fix to merge could make sense (do what you think is best).
One issue is that suggesting to use gcc10 as a workaround seem difficult, can't pass a new --compiler-bindir given seems it always overrides with latest compatible gcc.
But clang:13 + glibc-2.34 works even though the eclass doesn't consider it 👀 (cuda wants clang:12 that I didn't have around, so used NVCCFLAGS="-arch sm_61 -allow-unsupported-compiler"
though)
Not that I tested runtime, I never used blender so I wouldn't know what to check (I don't really use/know cuda much either).
That aside, haven't looked that closely but PR has my approval. In case forgot it existed, it's an improved version of the old unmerged #18663. I'm liking using NVCCFLAGS for arch a lot better and using cuda eclass sounds better too.
Don't need to go far to test (that's from cuda's tutorial, not that it actually prints hello world): $ cat > test.cu <<-EOF
#include <stdio.h>
__global__ void cuda_hello() {
printf("Hello World from GPU!\n");
}
int main() {
cuda_hello<<<1,1>>>();
return 0;
}
EOF
$ nvcc -o test test.cu
/usr/include/stdio.h(183): error: attribute "__malloc__" does not take arguments
$ nvcc --allow-unsupported-compiler --compiler-bindir /usr/lib/llvm/13/bin/clang -o test test.cu
(works) Edit: like nvidia's thread, further shows that it's entirely unrelated to opensubdiv anyhow. |
any ETA? :) |
Nope, it's the usual nvidia says "fixed internally" and then we wait for a new release which can be tomorrow or a month+, unfortunately I too don't have access to nvidia's internal-only bug tracker for updates. Edit: might add that they never answer if someone asks for ETA |
Well, it didn't take too long after all: see commit fb1cbae |
^ This was totally pressured by us! :) |
an outdated version.
enough CUDA versions.
overriding them.
Closes: https://bugs.gentoo.org/744517
Closes: https://bugs.gentoo.org/751382
Signed-off-by: Alexander Golubev fatzer2@gmail.com