negativo17 / cuda

NVIDIA Compute Unified Device Architecture Toolkit
14 stars 1 forks source link

CUDA 8 builds for Fedora 27 #5

Closed mjmg closed 6 years ago

mjmg commented 6 years ago

Hi I just upgraded my primary laptop to Fedora 27 but unfortunately my NVIDIA card is Fermi which was deprecated with CUDA 9.

I tried rebuilding your src rpms for cuda8 in Fedora 27 but I get the following error:

/usr/bin/strip: '/home/mjg/rpmbuild/BUILDROOT/cuda-8.0.61-6.fc27.x86_64/usr/share/cuda/samples/7_CUDALibraries/common/FreeImage/lib/darwin/libfreeimage.a:': No such file
/usr/bin/strip: 'Mach-O': No such file
/usr/bin/strip: 'universal': No such file
/usr/bin/strip: 'binary': No such file
/usr/bin/strip: 'with': No such file
/usr/bin/strip: '2': No such file
/usr/bin/strip: 'architectures:': No such file
/usr/bin/strip: '[i386]': No such file
/usr/bin/strip: '[x86_64]': No such file
error: Bad exit status from /var/tmp/rpm-tmp.b6UUS6 (%install)

Would it be possible to have CUDA 8 rpms in Fedora 27 and newer repositories in the future so at least I can rollback to those versions if necessary?

simonlui commented 6 years ago

See https://github.com/negativo17/nvidia-driver/issues/38.

mjmg commented 6 years ago

So no CUDA 8 for Fedora 27 then.

I was able to rebuild the cuda 8 and compat-gcc53 packages for Fedora 27. I patched the cuda.spec file to comment "%global __strip /bin/true" in cuda.spec and all packages for both src.rpms were compiled and installed successfully.

The following packages were then locked to their latest cuda 8 versions:

cuda-libs-1:8.0.61-6.fc27.*
cuda-cupti-1:8.0.61-6.fc27.*
cuda-samples-1:8.0.61-6.fc27.*
cuda-cusparse-devel-1:8.0.61-6.fc27.*
cuda-cusolver-1:8.0.61-6.fc27.*
cuda-cusolver-devel-1:8.0.61-6.fc27.*
cuda-nsight-1:8.0.61-6.fc27.*
cuda-cublas-devel-1:8.0.61-6.fc27.*
cuda-nvgraph-devel-1:8.0.61-6.fc27.*
cuda-nvvp-1:8.0.61-6.fc27.*
cuda-curand-1:8.0.61-6.fc27.*
cuda-curand-devel-1:8.0.61-6.fc27.*
cuda-cufft-devel-1:8.0.61-6.fc27.*
cuda-cudart-devel-1:8.0.61-6.fc27.*
cuda-cusparse-1:8.0.61-6.fc27.*
cuda-nvrtc-1:8.0.61-6.fc27.*
cuda-nvgraph-1:8.0.61-6.fc27.*
cuda-cupti-devel-1:8.0.61-6.fc27.*
cuda-cufft-1:8.0.61-6.fc27.*
cuda-1:8.0.61-6.fc27.*
cuda-extra-libs-1:8.0.61-6.fc27.*
cuda-cublas-1:8.0.61-6.fc27.*
cuda-nvrtc-devel-1:8.0.61-6.fc27.*
cuda-npp-1:8.0.61-6.fc27.*
cuda-cli-tools-1:8.0.61-6.fc27.*
cuda-nvml-devel-1:8.0.61-6.fc27.*
cuda-cudart-1:8.0.61-6.fc27.*
cuda-devel-1:8.0.61-6.fc27.*
cuda-npp-devel-1:8.0.61-6.fc27.*

ffmpeg-libs-0:3.3.5-2.fc27.*

With the release of cuda 9.1 for Fedora 27cuda-dnn should also be frozen.

scaronni commented 6 years ago

@mjmg yeah, sorry for that but it would be really complicated to maintain both. I will move CUDA 9.1 also to RHEL/CentOS as soon as all packaging issues will be solved.

I was able to rebuild the cuda 8 and compat-gcc53 packages for Fedora 27. I patched the cuda.spec file to comment "%global __strip /bin/true" in cuda.spec

There is "%global debug_package %{nil}" in the cuda.spec file, overriding it should not be needed.

If you rebuild these versions:

cuda-1:8.0.61-7
ffmpeg-0:3.4.1-1

You can also probably use the other packages from the multimedia repository.

I will make sure that compat-gcc-53 builds also for Fedora 27 in COPR:

https://copr.fedorainfracloud.org/coprs/slaanesh/compat-gcc-53/

mjmg commented 6 years ago

@scaronni sorry I didn't get what you mean. Please clarify if I get it right.

So to properly have CUDA 8 packages on Fedora 27: 1) Get latest CUDA src.rpm from https://negativo17.org/repos/multimedia/fedora-26/SRPMS/

Should I use cuda-gcc-6.4.0-1.fc26.src.rpm or compat-gcc-53-5.3.1-7.fc26.src.rpm?

2) Rebuild also ffmpeg-3.4.1-1.fc26.src.rpm ?

3) If I get errors with debug packages, how should I patch cuda.spec?

scaronni commented 6 years ago

Get latest CUDA src.rpm from https://negativo17.org/repos/multimedia/fedora-26/SRPMS/ cuda-8.0.61-7.fc26.src.rpm cuda-cudnn-7.0.5.15-1.fc26.src.rpm

Correct.

Should I use cuda-gcc-6.4.0-1.fc26.src.rpm or compat-gcc-53-5.3.1-7.fc26.src.rpm?

CUDA 8 is not compatible with any GCC above 5.3.1.

Rebuild also ffmpeg-3.4.1-1.fc26.src.rpm ?

Yes, so it links to the correct libnpp. If it's built for CUDA 8 (8.0), you should see this:

$ rpm -q --requires ffmpeg-libs | grep libnp
libnppicc.so.8.0()(64bit)
libnppig.so.8.0()(64bit)

If I get errors with debug packages, how should I patch cuda.spec?

What do you mean? Which error?

mjmg commented 6 years ago

I got this error as indicated on the first post.

$ rpmbuild -ba ~/rpmbuild/SPECS/cuda.spec
...
/usr/bin/strip: '/home/mjg/rpmbuild/BUILDROOT/cuda-8.0.61-6.fc27.x86_64/usr/share/cuda/samples/7_CUDALibraries/common/FreeImage/lib/darwin/libfreeimage.a:': No such file
/usr/bin/strip: 'Mach-O': No such file
/usr/bin/strip: 'universal': No such file
/usr/bin/strip: 'binary': No such file
/usr/bin/strip: 'with': No such file
/usr/bin/strip: '2': No such file
/usr/bin/strip: 'architectures:': No such file
/usr/bin/strip: '[i386]': No such file
/usr/bin/strip: '[x86_64]': No such file
error: Bad exit status from /var/tmp/rpm-tmp.b6UUS6 (%install)
...

That's why I I patched the cuda.spec file to comment "%global __strip /bin/true" in cuda.spec But you said its better to edit %global debug_package %{nil}. How?

mjmg commented 6 years ago

Unable to work using %global debug_package %{nil} flag. Uncommenting %global __strip /bin/true still works. Closing