![]() Install it.Īmong them, running import torchTimes reported errors, such as: Traceback (most recent call last):įile "/Users/jerry/anaconda3/lib/python3.7/site-packages/torch/_init_.py", line 84, in However, no matter whether it is the method of installing the official website or the detailed tutorials of netizens found on the Internet, various errors will appear (it took me more than half a day), so I adopt another method, which is to install the installation package compiled by others. Pytorch's official website states, Pytorch supporting cuda must be installed from source. Terminal input cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2Īt this point, the first part is installed. Terminal input cat /usr/local/cuda/version.txt $ echo -e '#include"cudnn.h"\n void main()' | nvcc -x c -o /dev/null -I/usr/local/cuda/include -L/usr/local/cuda/lib -lcudnn test: $ export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH Set the following environment variables to point to where cuDNN is located. $ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib/libcudnn* $ sudo cp cuda/lib/libcudnn* /usr/local/cuda/lib $ sudo cp cuda/include/cudnn.h /usr/local/cuda/include $ tar -xzvf cudnn-10.0-osx-圆4-v7.4.2.24.tgzĬopy the following files into the CUDA Toolkit directory, and change the file permissions. Navigate to your directory containing cuDNN. Your cuDNN directory path is referred to as I installed cudnn-10.0-osx-圆4-v7.4.2.24.tgzĪccording to the official tutorial as follows: your CUDA directory path is referred to as /usr/local/cuda/ After downloading, decompress and copy to the corresponding subdirectory of the CUDA installation directory. cd /usr/local/cuda/samplesĪfter downloading, you need to operate on the terminal, which are actually several library files. Verification: Enter the following command in the terminal, if Result=PASS, then CUDA can work normally. Since I installed 10.1 on the last line, I can change it according to the version I installed.Įxecute the command to restart bash_profile. Before, Need to install xcode, Because cuda10 does not support the latest xcode10, you must install xcode9.4, xcode can be found on the official website of Apple developers, 。Īfter installation, you need to set cuda-related environment variables,Open the terminal and type cd ~Īdd the following path at the end export CUDA_HOME=/usr/local/cudaĮxport DYLD_LIBRARY_PATH="$CUDA_HOME/lib:$CUDA_HOME/extras/CUPTI/lib"Įxport LD_LIBRARY_PATH=$DYLD_LIBRARY_PATHĮxport flags="-config=cuda -config=opt"Įxport PATH="/Developer/NVIDIA/CUDA-10.1/bin:$PATH" Installation package address:, This needs to be installed with the xcode version of the Mac. Next is to install the cuda driver, the installation package is under this website,, The same is graphical all the way to click Next to install, I installed this CUDA 418.105 driver for MAC。 You may need to set up on clover after installing the graphical interface.Īfter installing the graphics card driver, you can see the correct graphics card specifications under apple-about this machine-overview-graphics card. , For example, the MacOS image used is macOS 10.13.6 High Sierra (17G65), The corresponding driver is 387.10.10.10.40.105. One, the installation of the cuda environmentĭetermine the version of the Mac you installed to determine the Nvidia graphics driver, and check which version of the graphics driver your system image supports on this website. The first is cuda related Installation, the second is the installation of the gpu version of pytorch. ![]() All installations are divided into two parts. After the system is installed, the driver is installed, as follows: note:īecause Black Apple has strict driver requirements and NVIDIA no longer supports graphics card drivers after macOS High Sierra 10.13.6, the Mac version is selected at 10.13.6. Although the configuration cannot be used, it is still possible to write code and run examples, because I have all the data files In the MacBook, everyone is going to get a macOS black apple environment. It is not convenient to use a home computer instead. It is not very convenient to connect to the laboratory remotely for the epidemic situation. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |