No announcement yet.

CUDA on Linux via wine, 3DF Zephyr 5.009

  • Filter
  • Time
  • Show
Clear All
new posts

  • CUDA on Linux via wine, 3DF Zephyr 5.009


    I was able to install and render a 3d model from photographs pretty seamlessly with wine-staging 5.20. 3DF Zephyr was installed like so:

    WINEPREFIX="$HOME/zephyr" WINEARCH=win64 wine wineboot
    WINEPREFIX="$HOME/zephyr" WINEARCH=win64 winetricks dlls vcrun2015
    WINEPREFIX="$HOME/zephyr" WINEARCH=win64 wine winecfg  # Change to Windows 10 from Windows XP to allow installation
    WINEPREFIX="$HOME/zephyr" WINEARCH=win64 wine ~/Downloads/3DF+Zephyr+Free+v5.009+\(x64\).exe
    WINEPREFIX="$HOME/zephyr" WINEARCH=win64 wine $HOME/zephyr/drive_c/Program\ Files/3DF\ Zephyr\ Free/3DF\ Zephyr\ Free.exe
    However, despite having both an older CUDA card (Geforce GT 640) and a relatively newer one (Geforce GTX 1060), 3DF Zephyr reports that no CUDA cards could be found. CUDA-Z reports CUDA information for both cards, via Wine.

    WINEPREFIX="$HOME/zephyr" WINEARCH=win64 wine Downloads/CUDA-Z-0.10.251-64bit.exe
    Could there be some limitation involving the version of CUDA installed? For what it's worth, I also tried installing the DXVK winetricks with winetricks dlls dxvk

    % nvcc --version
    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2020 NVIDIA Corporation
    Built on Tue_Sep_15_19:10:02_PDT_2020
    Cuda compilation tools, release 11.1, V11.1.74
    Build cuda_11.1.TC455_06.29069683_0
    % nvidia-smi | grep CUDA
    | NVIDIA-SMI 455.38 Driver Version: 455.38 CUDA Version: 11.1 |
    I know Linux isn't officially supported, but since I've gotten this far, and there's not much wine activity on the forums thus far, hopefully this will help others as well.

  • #2
    Hi pukyix54 - Welcome to the forum!

    I'm not a Linux user but Andrea Alessi wrote a piece on How to run 3DF Zephyr on Linux using Wine which may have some helpful info:


    • #3
      Thanks for the welcome, and thanks to Andrea Alessi for that write up. Indeed, I used it to set up Zephyr originally, but just posted the above as a scriptable sequence of steps and to isolate 3DF Zephyr installation from anything else installed with wine that may conflict. Given the Stickied post about CUDA 11, I wasn't sure if something recently changed in 3DF Zephyr code and/or NVIDIA drivers between the version mentioned in the Ubuntu instructions at that link and the latest version. I'm happy to test things as well if it would help.


      • #4
        Hi pukyix54,

        my last test was a long time ago so I unfortunately cannot confirm that the latest version works. However, it should I think if you got to the point where zephyr starts up and runs, if wine works correctly with CUDA. That was the biggest hit-or-miss with my tests back when i wrote that guide.

        Note that the GT 640 has cuda capabilities 2.1, so even if setup correctly, zephyr won't be able to use it as it lacks the required hardware capabilities.

        Something that may be happening, is that since you're using the free version (which is capped to 1 card) zephyr detects both your cards, selects the first one available (the 640) and can't use it. Can you post a screenshot of your CUDA tab in the application options? Do you see them listed there? If so, it means that cuda is indeed working and you should simply click to select the correct card to toggle it.

        As a test, you could try installing our SDK, flowengine, which is natively built for linux:

        You can download and build FlowEngine Free and try running an example, then check the logs: if you correctly see the example built with flowengine run correctly in GPU mode (so you should see [GPU 0] whenever gpu computation happen) then this means that your cuda driver is correctly working.

        I hope this helps somehow! Let me know in case so I will be happy to update the writeup and the winehq page
        Last edited by Andrea Alessi; 2020-11-05, 11:25 AM.


        • #5
          Hi Andrea!

          I removed the 640 both physically, and by binding it to another kernel module (vfio-pci), just to rule that out. No change, but good thought anyway.

          I also updated to the latest nvidia and CUDA packages today, and tried running CUDA-Z in wine again. It worked fine, recognizing the 1060 as card 0.

          Yet, Zephyr still gives the startup warnings about not finding compatible CUDA video cards. In Tools -> Options, all that's shown in the CUDA tab is "No CUDA devices found on this system"

          I spent a while trying to build the FlowEngine examples, including setting linker flags provided by Magick++-config in `ccmake`, but still couldn't get them to compile.

          /usr/bin/c++ -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-7 -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -lMagick++-7.Q16HDRI -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI -lMagick++-7.Q16HDRI -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI -Wno-unused-result -std=c++11 -m64 -msse4.2 -fPIC -mstackrealign -fopenmp -O3 -DNDEBUG CMakeFiles/ExampleAdvanced.dir/examples/ExampleAdvanced.cpp.o CMakeFiles/ExampleAdvanced.dir/examples/FbxHelper.cpp.o -o ../redist/ExampleAdvanced ../lib/
          /usr/bin/ld: ../lib/ undefined reference to `Magick::Image::write(std::string const&)'
          /usr/bin/ld: ../lib/ undefined reference to `Magick::Image::read(std::string const&)'
          /usr/bin/ld: ../lib/ undefined reference to `Magick::Image::ping(std::string const&)'
          collect2: error: ld returned 1 exit status
          # ImageMagick demo works fine
          mkdir -p testmagick ; cd testmagick
          curl -LO
          g++ `Magick++-config --cxxflags --cppflags` -O2 -Wall -o magick++ magick++.cpp `Magick++-config --ldflags --libs`
          ./magick++ ; ls
          I've attached a couple screenshots; The first one is CUDA-Z, the second shows some CLI info, and CUDA-Z loading screen, in a dir where the native CUDA deviceQuery example compiled and ran fine.

          The following lines appear when running 3DF Zephyr with WINEDEBUG=trace+nvcuda, and may be related to an open bug [1] upstream. What version of CUDA is Zephyr compiled against? Perhaps it's too recent for Wine's nvcuda.dll, which may only support an earlier version of CUDA.
          00f4:trace:nvcuda:DllMain (0x7f7d6c770000, 1, (nil))
          00f4:trace:nvcuda:wine_cuDriverGetVersion (0xb5809c0)
          00f4:trace:nvcuda:wine_cuInit (0)
          00f4:trace:nvcuda:wine_cuGetExportTable (0xb580998, 0x3029400)
          00f4:fixme:nvcuda:cuda_check_table WARNING: Your CUDA version supports a newer interface for Unknown1 then the Wine implementation.
          00f4:trace:nvcuda:wine_cuGetExportTable (0xb5809a0, 0x30293e0)
          00f4:trace:nvcuda:wine_cuDeviceGetCount (0xb587280)
          00f4:trace:nvcuda:wine_cuDeviceGet (0x21cc50, 0)
          00f4:trace:nvcuda:Unknown1_func1_relay (0xb5874a8, (nil))
          00f4:trace:nvcuda:wine_cuDeviceGetName (0xb5874e8, 256, 0)
          00f4:trace:nvcuda:wine_cuDeviceTotalMem_v2 (0xb587608, 0)
          00f4:trace:nvcuda:wine_cuDeviceGetAttribute (0xb587650, 75, 0)
          I'll keep working on getting the FlowEngine examples to compile, but I think the CUDA version supported by Wine might be the showstopper.



          • #6
            Thank you for the followup!

            Zephyr is currently on cuda 10 so it's very possible that's the issue. Unfortunately if that's the case it seems there is currently no way to use GPU acceleration under wine, which is a bummer indeed