In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
1. Host configuration description
A few days ago, I learned that the company had purchased several new mainframes, so the leader of our group applied to the company for one to come back for data analysis.
The server is Hewlett-Packard mainframe, the model is: HP EliteDesk 800G3. It's not strong, but it's okay to be used for data analysis and testing of GPU.
Specific parameters:
CPU:i7-7700
Memory: 32 GB
Video card: GTX 1070
Hard disk: 256 ssd + 1T
Comes with windows 10 64-bit Professional Edition system
Build environment version selection: ubuntu18.04+CUDA9.0+cuDNN7.1.4+tensorflow1.9
two。 Replace the system
As the host comes with a windows system, but we want to use the ubuntu system, so we have to reinstall the system first.
The specific process of replacing the system will not be written. If you need it, you can refer to this article.
It is important to note that do not turn off the UEFI boot on the motherboard, and your Ubuntu system boot disk, that is, the USB disk, needs to use the USB3.0 interface. Because, when I tested, I could not identify those who had used the ordinary USB2.0 interface. At the same time, the system disk should be made into a pure system disk, which comes out of the system software and there are no other files.
3. Install the video card driver
After newly installing the ubuntu 18.04 system, update the source of the system first. When I use the linux series system such as CentOS or Ubuntu, I am used to changing to the source of Aliyun. I feel that the speed and stability are well maintained.
3.1 turn off the default video card driver of the system
If you are installing a version of ubuntu with a desktop graphical interface, then its default graphics card may be nouveau, and we need to close it first. Specific methods:
Open the disabled list:
Sudo vim / etc/modprobe.d/blacklist.conf
Add the following:
Blacklist nouveauoptions nouveau modeset=0
After saving and exiting, update and restart the system:
Sudo update-initramfs-usudo reboot
After rebooting, you may find that there is no output on the screen, or even the login interface.
Don't panic, if you use a terminal login tool like xshell, you can still connect to the system remotely, as long as you have openssh-server on the system, but ubuntu 18 does not enable openssh-server by default.
If you don't use xshell to connect, you can press ctrl + alt + F3. At this time, the screen will switch to the character login interface, enter the familiar user name, and the password interface will appear again.
This is all because we disabled the nouveau driver in the previous step, but the independent graphics driver for the host has not been installed yet.
3.2 install the nvidia graphics card driver
Before installing the video card driver, you also need to confirm which drivers are included in your system:
Kkt@kkt-HP:~$ sudo ubuntu-drivers devices [sudo] password for kkt: = / sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 = = modalias: pci:v000010DEd00001B81sv0000103Csd00006899bc03sc00i00vendor: NVIDIA Corporationmodel: GP104 [GeForce GTX 1070] driver: nvidia-driver-396-third-party freedriver: nvidia-driver-390-third-party freedriver: nvidia-driver-410-third-party freedriver: nvidia-driver-415-third-party free recommendeddriver: xserver-xorg-video-nouveau-distro free builtin
Yes, we can see that there are 396390410415 driver versions supported by nvidia. However, this is only after I added the graphics card ppa source to show so many, originally only two versions of 390396.
How to add video card ppa source:
Sudo add-apt-repository ppa:graphics-drivers/ppasudo apt update
When adding a ppa source, the update may fail due to network reasons. We need to pay attention to the prompt, thinking that if the addition fails, some versions cannot be installed at all.
Choose the version of nvidia you want to install. I recommend installing the version of nvidia-driver-396. Don't ask for the latest version, because the latest version may have poor compatibility or even won't work.
Install the nvidia driver:
Important: delete the old nvidia driver first
Sudo apt-get purge nvidia-*sudo apt install nvidia-driver-396
After the installation is complete, restart the host: sudo reboot
Check the status of the nvidia video card:
Sudo nvidia-smi
If you do not detect the status of the nvidia graphics card, you may need to mount it first:
Sudo nvidia modprobe nvidia
Normally, if your host has a stand-alone video card, after installing the nvidia video driver, reboot will output your familiar graphical login interface on the screen.
4. Install CUDA 9.0
First of all, the cuda 9.0 compiler installation only supports gcc, gcc + 6.0 and below, so if the system already has version 7.0 or above installed by default, you need to level it.
Sudo apt-get install gcc-4.8sudo apt-get install gallop music 4.8
To change to the / usr/bin directory and downgrade gcc7.0 is to recreate the soft connection:
Ls-l gcc* sudo mv gcc gcc.baksudo ln-s gcc-4.8 gccls-l g++*sudo mv gouging + g++.baksudo ln-s grubbing Muffin 4.8 gathers +
Re-check the versions of Gmail + and gcc:
Gmail +-vgcc-v
Just make sure that the version of gcc and Gmail + is 4.8.
Download CUDA 9.0
Note: do not use cuda 9.1 or cuda 10 for now, as these versions are not supported by later tensorflow. I also installed cuda 9.1 at the beginning, thinking that the newer version the better.
The archive directory for each version of cuda is here. Select version 9.0:
Note that the system version of ubuntu 16.04 is selected here, which also applies to 18.04.
Cuda 9.0A total of 5 files, including 4 patch, need to be downloaded. After the download is complete, upload to the server, install, cuda installation process, will prompt to install nvidia driver, do not install, because we have already installed. Other options are optional.
The installation process is as follows:
Sudo sh cuda_9.0.176_384.81_linux-runsudo sh cuda_9.0.176.1_linux-runsudo sh cuda_9.0.176.2_linux-runsudo sh cuda_9.0.176.3_linux-runsudo sh cuda_9.0.176.4_linux-run
Again, download cuDNN to install. The version of cuDNN is 7.1.4, and in most cases it will be fine, but when you use tensorflow for convolution, you will be prompted that the initialization failed because the supported version in tensorflow 1.9 is 7.1.4 or above.
Please download cuDNN here. Note that you need to provide a registered account for downloading. Set up your own mailbox to register.
After the download is complete, upload it to the server and start the installation:
In fact, it is first unzipped, and then copied to the cuda-9.0 directory. After the sudo tar xvzf cudnn-9.0-linux-x64-v7.1.tgz is unzipped, the default directory name is also called cuda. Then, copy the contents of cuDNN: sudo cp cuda/include/cudnn.h / usr/local/cuda/includesudo cp cuda/lib64/libcudnn* / usr/local/cuda/lib64. Finally, modify permissions: sudo chmod astatr / usr/local/cuda/include/cudnn.h / usr/local/cuda/lib64/libcudnn*
At this point, cuda and cudnn are installed.
However, you also need to modify the environment variables:
Modify sudo vim ~ / .bashrc, add the following: export CUDA_HOME=/usr/local/cudaexport LD_LIBRARY_PATH=$ {CUDA_HOME} / lib64export PATH=$ {CUDA_HOME} / bin:$ {PATH} modify sudo vim / etc/profile, add the following: export PATH=/usr/local/cuda/bin:$PATH
Continue to modify:
Sudo vim / etc/ld.so.conf.d/cuda.conf/usr/local/cuda/lib64
After modification, the configuration is loaded, but it may prompt: (/ usr/local/cuda/lib64/libcudnn.so.7 is not a symbolic link?)
Sudo ldconfigsudo ln-sf / usr/local/cuda/lib64/libcudnn.so.7.1.4 / usr/local/cuda/lib64/libcudnn.so.7sudo ldconfig
Finally, you can install tensorflow
5. Install tensorflow
Use pip to install:
Sudo pip3 install tensorflow-gpu==1.9.0
If there is no pip3, install it yourself:
Sudo apt install python3-pip
If the installation speed of pip3 is too slow, resulting in a timeout error, you can try to use domestic sources, specific methods:
Modify ~ / .pip/pip.conf (create one if not): if this folder does not exist, the content of the created mkdir ~ / .pipvi ~ / .pip / pip.conf is added as follows: [global] index-url= http://mirrors.aliyun.com/pypi/simple/[install]trusted-host=mirrors.aliyun.com6. Summary
It is worth noting that the version of tensorflow is strictly compatible.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.