Skip to content
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

nvcc fatal : Unknown option '-mavx' #2135

Open
shadow150519 opened this issue Nov 15, 2023 · 5 comments
Open

nvcc fatal : Unknown option '-mavx' #2135

shadow150519 opened this issue Nov 15, 2023 · 5 comments

Comments

@shadow150519
Copy link

I am configuring the project on wsl2. when I load the CMakeList.txt in the fbgemm_gpu folder, It gives the following error.

Cannot get compiler information:
	Compiler exited with error code 1: \usr\local\cuda\bin\nvcc -Dfbgemm_gpu_py_EXPORTS --generate-code=arch=compute_75,code=[compute_75,sm_75] -Xcompiler=-fPIC -std=c++17 -mavx -mf16c -mfma -mavx2 -fopenmp --dryrun /mnt/c/Users/Lenovo/AppData/Local/Temp/compiler-file16156068507273487186.cu
	nvcc fatal   : Unknown option '-mavx'
@q10
Copy link
Contributor

q10 commented Nov 16, 2023

Could you show the full logs, and let me know the nvcc, gcc, and cmake versions you are using? We don't have official support for building FBGEMM_GPU on WSL2, but if WSL2 works exactly the same as a regular Linux environment, then it may be just an issue with the nvcc and/or gcc versions.

@shadow150519
Copy link
Author

shadow150519 commented Nov 17, 2023

Here is the full logs.
nvcc version: Cuda compilation tools, release 12.3, V12.3.52
gcc version: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
cmake version: cmake version 3.25.3
OS: wsl2 Ubuntu20.4 on Windows10
wsl kernel version: 5.15.133.1-1
wsl version: 2.0.9.0

C:\Windows\system32\wsl.exe --distribution Ubuntu-20.04 --exec /bin/bash -c "export CMAKE_COLOR_DIAGNOSTICS=ON && export CLION_IDE=TRUE && export JETBRAINS_IDE=TRUE && cd /home/wtx/workspace/cpp_project/FBGEMM/fbgemm_gpu/cmake-build-fbgemm-gpu-debug && /usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/bin/gcc '-DCMAKE_CXX_COMPILER=/usr/bin/g++' '-DCMAKE_PREFIX_PATH=D:\workspace\cpp_project\libtorch' -G 'CodeBlocks - Unix Makefiles' -S /home/wtx/workspace/cpp_project/FBGEMM/fbgemm_gpu -B /home/wtx/workspace/cpp_project/FBGEMM/fbgemm_gpu/cmake-build-fbgemm-gpu-debug"
================================================================================
Building the CUDA variant of FBGEMM-GPU
================================================================================

================================================================================
Default C++ compiler flags
(values may be overridden by CMAKE_CXX_STANDARD and CXX_STANDARD):


================================================================================

-- The CXX compiler identification is GNU 9.4.0
-- The C compiler identification is GNU 9.4.0
-- The CUDA compiler identification is NVIDIA 12.3.52
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Performing Test C_HAS_AVX_1
-- Performing Test C_HAS_AVX_1 - Failed
-- Performing Test C_HAS_AVX_2
-- Performing Test C_HAS_AVX_2 - Success
-- Performing Test C_HAS_AVX2_1
-- Performing Test C_HAS_AVX2_1 - Failed
-- Performing Test C_HAS_AVX2_2
-- Performing Test C_HAS_AVX2_2 - Success
-- Performing Test C_HAS_AVX512_1
-- Performing Test C_HAS_AVX512_1 - Failed
-- Performing Test C_HAS_AVX512_2
-- Performing Test C_HAS_AVX512_2 - Failed
-- Performing Test C_HAS_AVX512_3
-- Performing Test C_HAS_AVX512_3 - Failed
-- Performing Test CXX_HAS_AVX_1
-- Performing Test CXX_HAS_AVX_1 - Failed
-- Performing Test CXX_HAS_AVX_2
-- Performing Test CXX_HAS_AVX_2 - Success
-- Performing Test CXX_HAS_AVX2_1
-- Performing Test CXX_HAS_AVX2_1 - Failed
-- Performing Test CXX_HAS_AVX2_2
-- Performing Test CXX_HAS_AVX2_2 - Success
-- Performing Test CXX_HAS_AVX512_1
-- Performing Test CXX_HAS_AVX512_1 - Failed
-- Performing Test CXX_HAS_AVX512_2
-- Performing Test CXX_HAS_AVX512_2 - Failed
-- Performing Test CXX_HAS_AVX512_3
-- Performing Test CXX_HAS_AVX512_3 - Failed
-- Skipping merge_pooled_embeddings sources
-- Configuring done
-- Generating done
-- Build files have been written to: /home/wtx/workspace/cpp_project/FBGEMM/fbgemm_gpu/cmake-build-fbgemm-gpu-debug

Cannot get compiler information:
	Compiler exited with error code 1: \usr\local\cuda\bin\nvcc -Dfbgemm_gpu_py_EXPORTS -g --generate-code=arch=compute_75,code=[compute_75,sm_75] -Xcompiler=-fPIC -std=c++17 -mavx -mf16c -mfma -mavx2 -fopenmp --dryrun /mnt/c/Users/Lenovo/AppData/Local/Temp/compiler-file11626473163701549697.cu
	nvcc fatal   : Unknown option '-mavx'

@q10
Copy link
Contributor

q10 commented Nov 29, 2023

Hmm, some of the tool versions you listed are not the recommended versions - in particular, CUDA should be at 12.1 and GCC should be at 10+.

I did quick Google search cases where users have run into a similar error signature before, and the solution was generally to upgrade the drivers and toolkit. That being said, we highly recommend using building and using FBGEMM in a full Linux environment instead, as WSL may contain intricacies that are beyond our scope for debugging issues like this.

@q10
Copy link
Contributor

q10 commented Nov 29, 2023

@shadow150519 could you try latest main, and run the usual FBGEMM_GPU build command, but with -DWSL_MODE=1 added to the args?

python setup.py  ...<usual args>...   -DWSL_MODE=1

(See here for build instructions in detail)

Let us know how this goes.

@shadow150519
Copy link
Author

sorry for the late response, I've moved to a linux machine right now and it works correctly. I'll try this and give you the result as soon as I can. Thank for your help :)

@shadow150519 could you try latest main, and run the usual FBGEMM_GPU build command, but with -DWSL_MODE=1 added to the args?

python setup.py  ...<usual args>...   -DWSL_MODE=1

(See here for build instructions in detail)

Let us know how this goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants